gdome2-0.8.1/0000777000076400007640000000000007740102244006452 5gdome2-0.8.1/Makefile.in0000664000076400007640000004241607740102237010446 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EXEEXT = @EXEEXT@ GDOME_INCLUDEDIR = @GDOME_INCLUDEDIR@ GDOME_LIBDIR = @GDOME_LIBDIR@ GDOME_LIBS = @GDOME_LIBS@ GDOME_VERSION_INFO = @GDOME_VERSION_INFO@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MIN_VERSION = @GLIB_MIN_VERSION@ GLIB_MKENUMS = @GLIB_MKENUMS@ GLIB_REQUIRED = @GLIB_REQUIRED@ GOBJECT_QUERY = @GOBJECT_QUERY@ HTML_DIR = @HTML_DIR@ LDFLAGS = @LDFLAGS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_MIN_VERSION = @XML_MIN_VERSION@ NULL = SUBDIRS = \ libgdome \ test \ gtk-doc \ $(NULL) confexecdir = $(libdir) confexec_DATA = gdomeConf.sh pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gdome2.pc m4dir = $(datadir)/aclocal m4_DATA = gdome2.m4 bin_SCRIPTS = gdome-config man_MANS = gdome-config.1 EXTRA_DIST = \ COPYING.LIB \ MAINTAINERS \ AUTHORS \ NEWS \ gdomeConf.sh.in \ gdome-config.in \ gdome2.spec \ gdome2.m4 \ gdome-config.1 \ gdome2.pc.in \ README.developer \ $(NULL) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = gdome-config gdome2.spec gdome-config.1 gdome2.pc SCRIPTS = $(bin_SCRIPTS) man1dir = $(mandir)/man1 MANS = $(man_MANS) NROFF = nroff DATA = $(confexec_DATA) $(m4_DATA) $(pkgconfig_DATA) DIST_COMMON = README ./stamp-h.in AUTHORS COPYING COPYING.LIB ChangeLog \ INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 config.guess \ config.h.in config.sub configure configure.in gdome-config.1.in \ gdome-config.in gdome2.pc.in gdome2.spec.in install-sh ltmain.sh \ missing mkinstalldirs DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best all: all-redirect .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ 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): @MAINTAINER_MODE_TRUE@ configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(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: @MAINTAINER_MODE_TRUE@$(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: gdome-config: $(top_builddir)/config.status gdome-config.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status gdome2.spec: $(top_builddir)/config.status gdome2.spec.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status gdome-config.1: $(top_builddir)/config.status gdome-config.1.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status gdome2.pc: $(top_builddir)/config.status gdome2.pc.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_SCRIPTS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ else if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ else :; fi; fi; \ done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) list='$(bin_SCRIPTS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ done install-man1: $(mkinstalldirs) $(DESTDIR)$(man1dir) @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ done uninstall-man1: @list='$(man1_MANS)'; \ l2='$(man_MANS)'; for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ rm -f $(DESTDIR)$(man1dir)/$$inst; \ done install-man: $(MANS) @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-man1 uninstall-man: @$(NORMAL_UNINSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 install-confexecDATA: $(confexec_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(confexecdir) @list='$(confexec_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(confexecdir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(confexecdir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(confexecdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(confexecdir)/$$p; \ fi; fi; \ done uninstall-confexecDATA: @$(NORMAL_UNINSTALL) list='$(confexec_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(confexecdir)/$$p; \ done install-m4DATA: $(m4_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(m4dir) @list='$(m4_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4dir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(m4dir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(m4dir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(m4dir)/$$p; \ fi; fi; \ done uninstall-m4DATA: @$(NORMAL_UNINSTALL) list='$(m4_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(m4dir)/$$p; \ done install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir) @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p; \ fi; fi; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) list='$(pkgconfig_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(pkgconfigdir)/$$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 --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) -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 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-binSCRIPTS install-confexecDATA install-exec: install-exec-recursive install-data-am: install-man install-m4DATA install-pkgconfigDATA install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall-binSCRIPTS uninstall-man uninstall-confexecDATA \ uninstall-m4DATA uninstall-pkgconfigDATA uninstall: uninstall-recursive all-am: Makefile $(SCRIPTS) $(MANS) $(DATA) 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)$(bindir) $(DESTDIR)$(mandir)/man1 \ $(DESTDIR)$(confexecdir) $(DESTDIR)$(m4dir) \ $(DESTDIR)$(pkgconfigdir) 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-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-binSCRIPTS install-binSCRIPTS install-man1 uninstall-man1 \ install-man uninstall-man uninstall-confexecDATA install-confexecDATA \ uninstall-m4DATA install-m4DATA uninstall-pkgconfigDATA \ install-pkgconfigDATA 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 gdomeConf.sh: gdomeConf.sh.in Makefile sed -e 's?\@GDOME_LIBDIR\@?$(GDOME_LIBDIR)?g' \ -e 's?\@GDOME_INCLUDEDIR\@?$(GDOME_INCLUDEDIR)?g' \ -e 's?\@PACKAGE\@?$(PACKAGE)?g' \ -e 's?\@VERSION\@?$(VERSION)?g' \ -e 's?\@GDOME_LIBS\@?$(GDOME_LIBS)?g' \ < $(srcdir)/gdomeConf.sh.in > gdomeConf.tmp \ && mv gdomeConf.tmp gdomeConf.sh # 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: gdome2-0.8.1/README0000664000076400007640000000155507740026451007263 GDOME2 0.8.1 ------------ DOM level2 library for accessing XML files based on libxml2. With gdome2 programmers can work with XML documents with an interface that is: - easy to use - compliant to W3C standards - a required step towards world DOMination * Installing To install, run $ ./configure $ make $ make check $ make install If installing from CVS, use ./autogen.sh instead of ./configure For more details, see the INSTALL file. * Features Supports the following DOM Level 2 modules: - "Core"; - "XML"; - "Events"; - "MutationEvents". Partial support for the following DOM Level 3 module: - "XPath" Exports an object oriented inteface with a reference counting system responsible of all memory issues. * DOM2 Recommendation: - http://www.w3.org/TR/DOM-Level-2-Core/ - http://www.w3.org/TR/DOM-Level-2-Events/ gdome2-0.8.1/stamp-h.in0000664000076400007640000000001207740102236010263 timestamp gdome2-0.8.1/AUTHORS0000664000076400007640000000042407452524625007453 Raph Levien Ian Main Daniel Veillard Mathieu Lacage Anders Carlson Paolo Casarini Luca Padovani T.J. Mather gdome2-0.8.1/COPYING0000644000000000000000000004311007437370270007367 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. gdome2-0.8.1/COPYING.LIB0000664000076400007640000006347607311512644010053 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! gdome2-0.8.1/ChangeLog0000664000076400007640000040332007740100334010142 2003-10-05 Paolo Casarini * configure.in, README, gdome2.spec.in - fixed dipendencies - now gdome2 depends by default from glib2 - added "enable-glib-1" flag to compile gdome2 with glib1 - updated for 0.8.1 release - deleted traversal module related rule * libgdome/gdome-treegc.[ch] removed some dead code 2003-10-03 Luca Padovani * fixed configure.in so that it checks correctly for glib-2.0 * fixed dependencies in gdome2.pc * added inline versions for simple functions in gdome-xsmlutil.h. The inline versions are currently disabled by they can be easily enabled by defining a macro at the top of the file * removed some dead code within #ifdef LUCA in several files * added missing #include directive in gdome.c 2003-09-10 Paolo Casarini * configure.in, README Updated for 0.8.0 release * gtk-doc/ * libgdome/gdome.c * libgdome/gdomecore/gdome-xml-domimpl.c Updated documentation 2003-09-09 Luca Padovani * Re-enabled --enable-glib-2 flag for supporting GLIB 2.x. The code seems to compile and run OK. 2003-07-28 Paolo Casarini * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_xml_di_createDocument) Deleted duplicated checks on the qualifiedName and now is always used the gdome_xml_doc_createElementNS. * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_removeChild) Modified the check on the oldChild parameter from GDOME_XML_IS_N to GDOME_XML_IS_TREE_N to prevent errors. 2003-07-22 Paolo Casarini * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_createElementNS) patched to allow the creation of node that belogs to the default namespace (no prefix and namespaceURI!=NULL) * libgdome/gdomecore/gdome-xml-text.c (gdome_xml_t_splitText) patched to always initialize gparent before use 2003-07-18 Luca Padovani * internally events are initialized by their code directly. This saves one allocation of a GdomeDOMString, and one lookup for mapping the event name into the event code. Auxiliary functions have been implemented into *-event.c and *-mevent.c 2003-07-17 Paolo Casarini * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_createAttributeNs) patched to allow namespaceURI = NULL * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_unref) moved the delNode call before checking for removal * test/test-treegc.c Modified to follow changes in the treegc behaviour * libgdome/events/gdome-evt-event.[ch] (struct _Gdome_evt_Event) field type change from gchar* to guint32 (gdome_evt_evnt_initEvent) modified to follow the type field change (gdome_evt_evnt_type) modified to follow the type field change * libgdome/events/gdome-evt-mevent.h (struct _Gdome_evt_MutationEvent) field type change from gchar* to guint32 (gdome_evt_mevnt_unref) modified to follow the type field change * libgdome/events/gdome-evt-propagation.c (gdome_evt_fireEvent) modified to folloe the type field change * libgdome/gdomecore/gdome-xml-node.[ch] (Gdome_xml_ListenerList) field type change from char* to guint32 (gdome_xml_n_addEventListener) modified to follow the type field change (gdome_xml_n_removeEventListener) modified to follow the type field change (gdome_xml_n_dispatchEvent) modified to follow the type field change 2003-07-14 Paolo Casarini * libgdome/events/gdome-evt-propagation.c (gdome_evt_invokeListeners) removed, no more used (gdome_evt_invokeListerner_new) renamed in gdome_evt_invokeListeners (gdome_evt_fireEvent1) removed, no more used (gdome_evt_fireEvent2) removed, no more used * libgdome/events/gdome-xml-node.[ch] (Gdome_xml_ListenerList) removed porcessing and toRemove fields no more used in event propagation. (gdome_xml_n_addEventListener) modified to follow Gdome_xml_ListenerList and event propagation changes (gdome_xml_n_removeEventListener) modified to follow Gdome_xml_ListenerList and event propagation changes 2003-07-13 Luca Padovani * added methods for filtering fired events * changed the tree GC mechanism. The document tree is now freed only when there are no wrappers left. This fixes a reported bug and should improve performances as it is no longer necessary to count the live nodes in subtrees for adjusting the livenodes field. 2003-04-25 Paolo Casarini * libgdome/events/gdome-evt-propagation.h (gdome_evt_invokeListeners) removed from header * libgdome/events/gdome-evt-propagation.h (Gdome_evt_PropagationEl) added this new structure to build propagation simple lists. (gdome_evt_fireEvent) Modified to use three simple list, one for each propagation phase, to store the node-listeners pairs. (gdome_evt_invokeListeners_new) added to call handleEvent on the lists made by Gdome_evt_PropagationEl. (gdome_evt_fireEvents1) is the previous functin based on GList. 2003-03-31 Paolo Casarini * libgdome/events/gdome-evt-propagation.c (gdome_evt_fireEvent) Modified to use a GList instead of a dynamic array to store the propagation path. Now to save the propagation path, only gdome wrappers that have at least one listener are stored instead of all subordinate libxml2 nodes as done before. (gdome_evt_fireEvent2) inserted. Is the old gdome_evt_fireEvent. 2003-03-10 Paolo Casarini * configure.in, README Updated for 0.7.4 release * gtk-doc/ Updated documentation 2003-03-03 Luca Padovani * gdome-xml-evntl.? added callback for finalization of eventlistener objects 2003-01-29 Paolo Casarini * configure.in Updated libxml2 min version to 2.4.26 2003-01-21 Paolo Casarini * gdome-xml-node.h (gdome_xml_n_appendChild) bug fix in treegc (gdome_xml_n_replaceChild) now works also to replace the documentElement node 2003-01-10 Paolo Casarini * gdome-xml-node.h Added the "extern" modifier to all gdome-xml-n-vtab const declaration (Thanx to Alexandr Petrosian) * gdome-xml-memory.c Added the "static" modifier to all 'const xmlChar' declarations (Thanx to Alexandr Petrosian) * gdome-xml-node.c (gdome_xml_n_removeEventListener) bug fix on searching the listener to remove 2003-01-08 Paolo Casarini * gdome-xml-node.c * gdome-xml-text.c Fixed all occurrences of DOMSubtreeModified initialization changing the canBubbleArg from FALSE to TRUE. * gdome-xml-node.c (gdome_xml_n_addEventListener) Now check duplicates only on parameters 2003-01-07 Paolo Casarini * Makefile.am Added declaration for pkgconfig support (EXTRA_DIST) added gdome2.m4 and gdome2.pc.in * configure.in Updated to release 0.7.3 with libxml2 min ver set to 2.4.23 (AC_OUTPUT) removed comment line and added gdome2.pc (HTML_DIR) changed the default directory and the description * gdome2.m4 * gdome2.pc.in Added to CVS * configure.in Removed the GLIB2 flag to enable/disable a not yet implemented glib2 support. * gdome2.spec.in Applied patch provided by Oron Peled - %defattr(-,root,root) wasn't set for documents in the devel package. This cause wrong ownership of docs in non-root builds. Fixed. - Update URL: and Source: locations - s/Copyright:/License:/ 2002-11-08 Paolo Casarini * Makefile.am (EXTRA_DIST) added README.developer (Tobias Peters patch) * test/apigen/Makefile.am (EXTRA_DIST) added xpath.xml (Tobias Peters patch) 2002-09-14 T.J. Mather * test/test-xpath.c test failures should return FALSE libxml2 2.4.23 namespace order changed, updated test to reflect this * test/test-document3.xml Added ATTLIST for tns:NODE, required for libxml2 2.4.23 and greater 2002-07-16 T.J. Mather * libgdome/Makefile.am * libgdome/gdome-libxml-util.h Added header to private interface for XML::LibXML to use, patch provided by Christian Glahn. 2002-05-30 Paolo Casarini * configure.in (VERSION) updated to 0.7.2 (XML_MIN_VERSION) updated to 2.4.21 * libgdome/traversal/gdome-trv-nodeiterator.[ch} (struct _Gdome_trv_NodeIterator) added field entityReferenceExpansion (gdome_trv_ni_mkref) added entityReferenceExpansion to prototype and implemented (gdome_trv_ni_ref) implemented (gdome_trv_ni_unref) implemented (gdome_trv_nodefilter.h) added in include (gdome-xml-node.h) added in include (gdome_trv_ni_query_interface) implemented (gdome_trv_ni_root) implemented (gdome_trv_ni_whatToShow) implemented (gdome_trv_ni_filter) implemented (gdome_trv_ni_expandEntityReference) implemented (gdome_trv_ni_detach) implemented 2002-05-28 T.J. Mather * libgdome/gdome-treegc.c * libgdome/gdomecore/gdome-xml-document.c * test/Makefile.am * test/test-importnode.c Fixed bug when importing Entity Reference Node 2002-05-23 Paolo Casarini * libgdome/gdome.[ch] (gdome_di_saveDocToMemory) changed the type of the mem parameter from char* to char** (gdome_di_saveDocToFileEnc) added (gdome_di_saveDocToMemoryEnc) added * test/apigen/core.xml (saveDocToMemory) changed the type of the mem parameter from char* to char** in the DOMImplementation interface (saveDocToFileEnc) added (saveDocToMemoryEnc) added * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_di_saveDocToMemory) changed the type of the mem parameter from char* to char** (gdome_xml_di_saveDocToFileEnc) added (gdome_xml_di_saveDocToMemoryEnc) added * test/test-loadsave.c Modified to test gdome_di_saveDocToMemmory and gdome_di_saveDocToMemoryEnc Updated Documentation 2002-05-15 Paolo Casarini * libgdome/gdome.[ch] (gdome_di_saveDocToMemory) changed the type of the mem parameter from char** to char* * test/apigen/core.xml (saveDocToMemory) changed the type of the mem parameter from char** to char* in the DOMImplementation interface * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_di_saveDocToMemory) changed the type of the mem parameter from char** to char* * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_removeChild) moved the dispatch of "DOMSubtreeModified" before inlink the node from the tree. * libgdome/events/gdome-evt-event.h * libgdome/events/gdome-evt-eventl.h * libgdome/events/gdome-evt-mevent.h * libgdome/gdomecore/gdome-xml-attribute.h * libgdome/gdomecore/gdome-xml-cdata.h * libgdome/gdomecore/gdome-xml-cdata.h * libgdome/gdomecore/gdome-xml-cdatas.h * libgdome/gdomecore/gdome-xml-comment.h * libgdome/gdomecore/gdome-xml-document.h * libgdome/gdomecore/gdome-xml-documentf.h * libgdome/gdomecore/gdome-xml-documentt.h * libgdome/gdomecore/gdome-xml-domimpl.h * libgdome/gdomecore/gdome-xml-element.h * libgdome/gdomecore/gdome-xml-entity.h * libgdome/gdomecore/gdome-xml-entityref.h * libgdome/gdomecore/gdome-xml-nnodem.h * libgdome/gdomecore/gdome-xml-node.h * libgdome/gdomecore/gdome-xml-nodel.h * libgdome/gdomecore/gdome-xml-notation.h * libgdome/gdomecore/gdome-xml-pi.h * libgdome/gdomecore/gdome-xml-text.h * libgdome/gdomecore/gdome-xml-xpns.h * libgdome/traversal/gdome-trv-nodefilter.h * libgdome/traversal/gdome-trv-nodeiterator.h * libgdome/traversal/gdome-xpath-xpeval.h * libgdome/traversal/gdome-xpath-xpnsresolv.h * libgdome/gdomecore/gdome-xpath-xpresult.h Added the "extern" modifier to all gdome-*-*-vtab const declaration (Thanx to Tobias Peters) * gtk-doc/gdome2-sections.txt * gtk-doc/tmpl/etypes.sgml Updated Updated Documentation 2002-04-17 T.J. Mather * libgdome/gdomecore/gdome-xml-document.c * libgdome/gdomecore/gdome-xml-node.c Added support for handling HTML documents like XML documents 2002-04-16 T.J. Mather * test/test-xpath.c Added test for when XPath returns no results. * libgdome/xpath/gdome-xpath-xpresult.c Fixed bug when XPath result set is empty. 2002-04-05 Paolo Casarini * configure.in (XML_MIN_VERSION) updated to 2.4.19 * libgdome/gdomecore/gdome-xml-nnodem.c (itemHashScanner) modified to fit xmlHashScanner prototype * libgdome/gdomecore/gdome-xml-document.c (idsHashScanner) modified to fit xmlHashScanner prototype * libgdome/gdomecore/gdome-xml-xmldtdutil.c (notationsHashScanner) modified to fit xmlHashScanner prototype (entitiesHashScanner) modified to fit xmlHashScanner prototype * gtk-doc/Makefile.am (EXTRA_DIST) Added html/gdome2-xpath.html and html/gdome2-xpath-basic-types-and-enumerations.html 2002-04-04 Paolo Casarini * AUTHORS Added Luca Padovani and T.J. Mather * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_xml_di_createDocFromMemory) (gdome_xml_di_createDocFromURIWithEntitiesTable) (gdome_xml_di_createDocFromMemoryWithEntitiesTable) Added GDOME_LOAD_COMPLETE_ATTR in documentation. * libgdome/gdome.c (gdome_xml_createDocFromMemory) (gdome_xml_createDocFromURIWithEntitiesTable) (gdome_xml_createDocFromMemoryWithEntitiesTable) Added GDOME_LOAD_COMPLETE_ATTR in documentation. * gtk-doc/Makefile.am (EXTRA_DIST) html filename w.r.t XPath module modified * libgdome/Makefile.am removed traversal references * test/Makefile.am (EXTRA_DIST) Added test data file test-xpath.xml * gdome2.spec.in Updated Updated Documentation 2002-04-01 Daniel Veillard * libgdome/gdome-treegc.c libgdome/events/gdome-evt-event.h libgdome/events/gdome-evt-propagation.c libgdome/gdomecore/gdome-xml-attribute.c libgdome/gdomecore/gdome-xml-cdata.c libgdome/gdomecore/gdome-xml-document.c libgdome/gdomecore/gdome-xml-documentt.c libgdome/gdomecore/gdome-xml-domimpl.c libgdome/gdomecore/gdome-xml-element.c libgdome/gdomecore/gdome-xml-entity.c libgdome/gdomecore/gdome-xml-nnodem.c libgdome/gdomecore/gdome-xml-node.c libgdome/gdomecore/gdome-xml-nodel.c libgdome/gdomecore/gdome-xml-notation.c libgdome/gdomecore/gdome-xml-pi.c libgdome/gdomecore/gdome-xml-str.c libgdome/gdomecore/gdome-xml-text.c libgdome/gdomecore/gdome-xml-xmldtdutil.c libgdome/gdomecore/gdome-xml-xmlmemory.c libgdome/gdomecore/gdome-xml-xmlutil.c libgdome/gdomecore/gdome-xml-xpns.c libgdome/gdomehtml/gdome-xml-htmlcollection.c libgdome/gdomehtml/gdome-xml-htmldocument.h libgdome/gdomehtml/gdome-xml-htmlelement.c libgdome/xpath/gdome-xpath-xpresult.h test/test-events.c test/test-gdome.c: updated all the includes for libxml to use #include since it's the supported way and to avoid headers name clashes ( especially with tree.h) 2002-02-28 T.J. Mather * libgdome/gdome-xpath.[c|h] * libgdome/gdome.h * libgdome/xpath/Makefile.am * libgdome/xpath/gdome-xpath-xpresult.[c|h] * libgdome/xpath/gdome-xpath-xpsetiter.[c|h] * test/test-xpath.c * test/apigen/xpath.xml Replaced XPathSetIterator module with XPathResult.iterateNext method, to reflect change made in DOM Level 3 XPath working document. 2002-02-25 T.J. Mather * libgdome/gdomecore/gdome-xml-document.c * libgdome/gdomecore/gdome-xml-element.c * test/test-element.c * test/test-element.xml Fixed bug when gdome_n_unref on document node was called before gdome_nnm_unref. 2002-02-22 T.J. Mather * BUGS Added bugs files * README.developer Added developer README file * libgdome/gdome.c Added Level 3 DOM XPath Module Added support for namespace declaration attributes * libgdome/gdome.h Added GDOME_LOAD_COMPLETE_ATTR option Added Level 3 DOM XPath Module Added support for namespace declaration attributes * libgdome/gdomecore/gdome-xml-attribute.[ch] * libgdome/gdomecore/gdome-xml-document.c * libgdome/gdomecore/gdome-xml-documentt.c * libgdome/gdomecore/gdome-xml-element.c * libgdome/gdomecore/gdome-xml-node.c * libgdome/gdomecore/gdome-xml-nnodem.[ch] * libgdome/gdomecore/gxome-xml-util.h * libgdome/gdomecore/gdome-xml-xmlutil.[ch] Added support for namespace declaration attributes * libgdome/gdomecore/gdome-xml-cdata.c Memory leak fix * libgdome/gdomecore/gdome-xml-domimpl.c * gtk-doc/tmpl/types.sgml * gtk-doc/gdome2-decl.txt Added GDOME_LOAD_COMPLETE_ATTR option * libgdome/gdomecore/gdome-xml-xpns.[ch] * libgdome/xpath/gdome-xpath-xpeval.[ch] * libgdome/xpath/gdome-xpath-xpresolv.[ch] * libgdome/xpath/gdome-xpath-xpresult.[ch] * libgdome/xpath/gdome-xpath-xpsetiter.[ch] * libgdome/gdome-xpath.[ch] * libgdome/Makefile.am * configure.in Added Level 3 DOM XPath Module * test/apigen/core.xml added XPathNamespace interface added "automatically generated" message * test/apigen/events.xml added "automatically generated" message * test/apigen/xpath.xml Added Level 3 DOM XPath Module * test/apigen/srcutil.c Added Level 3 DOM XPath Module * test/test-namednodemap.c * test/test-namednodemap.xml * test/test-element.c * test/test-element.xml added tests for namespace declaration attributes * test/Makefile.am * test/test-xpath.c * test/test-xpath.xml added tests for XPath module 2002-01-14 Paolo Casarini * test/apigen/Makefile (EXTRA_DIST) Added events.xml and traversal.xml * test/apigen/srcutil.c (writeException) now manage also int32 method and attribute type * test/apigen/traversal.xml (added to CVS) (NodeFilter) INTERFACE added (NodeIterator) INTERFACE added * libgdome/Makefile Added traversal directory to the build process Added libgdometraversal.la to libgdome.la build process * configure.in Added traversal Makefile to the build process * ligdome/gdome.h (GdomeNodeFilter) typedef added (GdomeNodeIterator) typedef added (GdomeTreeWalker) typedef added * libgdome/gdome-traversal.[ch] (added to CVS) external interface for Traversal Level 2 Module (GdomeNodeFilterVtab) added (GdomeNodeIteratorVtab) added (GdomeTreeWalkerVtab) added (GdomeFilterResultType) implemented (GdomeWhatToShowType) implemented (struct _GdomeNodeFilter) implemented (struct _GdomeNodeIterator) implemented (struct _GdomeTreeWalker) implemented (gdome_nf_mkref) external API implemented (gdome_nf_ref) external API implemented (gdome_nf_unref) external API implemented (gdome_nf_query_interface) external API implemented (gdome_nf_acceptNode) external API implemented (gdome_ni_root) external API implemented (gdome_ni_whatToShow) external API implemented (gdome_ni_filter) external API implemented (gdome_ni_expandEntityReference) external API implemented (gdome_ni_ref) external API implemented (gdome_ni_unref) external API implemented (gdome_ni_query_interface) external API implemented (gdome_ni_nextNode) external API implemented (gdome_ni_previousNode) external API implemented (gdome_ni_detach) external API implemented * libgdome/traversal (added to CVS) directory where to implement Traversal Level 2 module * libgdome/traversal/Makefile (added to CVS) gives instructions on building libgdometraversal.la * libgdome/traversal/gdome-trv-nodefilter.[ch] (added to CVS) (Gdome_trv_NodeFilter) implemented (struct _GdomeNodeFilterVtab) implemented (gdome_trv_nf_mkref) internal API implemented (gdome_trv_nf_ref) internal API implemented (gdome_trv_nf_unref) internal API implemented (gdome_trv_nf_query_interface) internal API implemented (gdome_trv_nf_acceptNode) internal API implemented * libgdome/traversal/gdome-trv-nodeiterator.[ch] (added to CVS) (Gdome_trv_NodeIterator) implemented (struct _GdomeNodeIteratorVtab) implemented (gdome_trv_ni_root) internal empty prototype added (gdome_trv_ni_whatToShow) internal empty prototype added (gdome_trv_ni_filter) internal empty prototype added (gdome_trv_ni_expandEntityReference) internal empty prototype added (gdome_trv_ni_mkref) internal empty prototype added (gdome_trv_ni_ref) internal empty prototype added (gdome_trv_ni_unref) internal empty prototype added (gdome_trv_ni_query_interface) internal empty prototype added (gdome_trv_ni_nextNode) internal empty prototype added (gdome_trv_ni_previousNode) internal empty prototype added (gdome_trv_ni_detach) internal empty prototype added * libgdome/traversal/gdome-trv-treewalker.[ch] (added to CVS) added empty 2002-01-09 Paolo Casarini * gdome2.spec.in URL and Source updated * libgdome/gdome.h (GdomeException) changed type from guint to guint32 (GdomeExcetionType) added (GdomeExceptionMasks) added (GDOME_EXCEPTION_TYPE) macro added (GDOME_EXCEPTION_CODE) macro added * libgdome/gdome-events.h (GdomeEventException) removed (GDOME_UNSPECIFIED_EVENT_TYPE_ERR) Modified from 257 to 0 * libgdome/gdome-xml-node.c (gdome_xml_n_dispatchEvent) Updated Exception handling 2001-12-21 Paolo Casarini * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_di_parseFile) removed (gdome_xml_di_validateFile) removed (gdome_xml_di_saveFile) removed (gdome_xml_di_saveFormatFile) removed * libgdome/gdome.[ch] (gdome_di_parseFile) removed (gdome_di_validateFile) removed (gdome_di_saveFile) removed (gdome_di_saveFormatFile) removed * test/apigen/* Updated * configure.in Modified for release 0.7.0 * gdome2.spec.in Updated * README Updated 2001-12-03 Paolo Casarini * configure.in (AC_SUBST) Added GLIB_LIBS * libgdome/Makefile.am (libgdome_la_LIBADD) Added GLIB_LIBS and LIBXML_LIBS * test/test-node.c Modified to follow new treegc features * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_replaceChild) Reference counting bug fix (gdome_xml_n_appendChild) Bugs fix related to DocumentFragment node and treegc (gdome_xml_n_insertBeforeChild) Bugs fix related to DocumentFragment node and treegc * libgdome/gdome-treegc.c (gdome_treegc_insertSubtree) Modified to handle XML_DOCUMENT_FRAG_NODE * libgdome/gdomecore/gdome-xmlutil.[ch] (gdome_xmlSetFirstChild) Added * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_doctype) Modified to link always intSubset * configure.in (gdome-config.1.in) added * gdome-config.in Modified to use prefix and exec-prefix outputting cflags and libs result * libgdome/gdome.h (GdomeExceptionCode) Added GDOME_NOEXCEPTION_ERR = 0 (GdomeException) modified from unsigned short to guint * libgdome/gdome-events.h (GdomeEventExceptionCode) Modified GDOME_UNSPECIFIED_EVENT_TYPE_ERR from 0 to 257. * gtk-doc/ - Added a new main section called "Memory Management System" - Moved private-list documentation to the new main section - Added a new section related to treegc module in the new main section - Declared DEPRECATED! som old functions in GdomeDOMImplementation interface CVS Removed gdome-config.1 Added gdome-config.1.in 2001-11-30 Paolo Casarini * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_replaceChild) Modified to raise NO_MODIFICATION_ALLOWED_ERR, before HIERARCHY_REQUEST_ERR. (gdome_xml_n_childNodes) Modified to return an empty NodeList, instead NULL, if the specified node is a node that can't have childrens. * lingdome/gdomecore/gdome-xml-util.h (GDOME_XML_IS_LEAF_N) Added * libgdome/gdomecore/gdome-xml-nodel.c (gdome_xml_nl_length) Modified to return 0L if the specified node is "leaf" node (gdome_xml_nl_item) Modified to return NULL if the specified node is "leaf" node * test/test-cdata.c Modified to test Text.childNodes * test/test-dtd.c Modified to test DocumentType.childNodes and Notation.childsNodes 2001-11-28 Paolo Casarini - Changed the type of all unsigned long parameters, variables and return values to gulong - Changed the type of all unsigned short parameters, variables and return values to gushort * libgdome/gdome-treegc.c Modified comments on parameters * libgdome/gdome-xml-nnodem.c (gdome_xml_nnm_mkref) Added memset call to reset Gdome_xml_NamedNodeMap after creation * libgdome/gdome-xml-domimpl.c (gdome_xml_di_mkref) Added memset call to reset Gdome_xml_DOMImplementation after creation 2001-11-23 Paolo Casarini * test/apigen/core.xml Added INVALID_STATE_ERR EXCEPTION to attrs and methods of NodeList and NamedNodeMap interfaces. Added IMPLEMENTATION to gdome_nl_unref and to gdome_nnm_unref. 2001-11-22 Paolo Casarini * test/apigen/apigen.c (createInterfaceAPI) Modified to read the name of attribute from the attribute NAME instead of the content of the ATTR node. Modified also to read EXCEPTION info from the xml. Modified also to read IMPLEMENTATION info from xml. * test/apigen/srcutil.c (writeAttribute) modified to write Exception handler (writeMethod) modified to write Exception handler and Implementation (writeCheck) deleted (writeException) Added * test/apigen/core.xml * test/apigen/events.xml Modifed all ATTR Node moving the name of the attribute specified from the content to the the attribute NAME. Modified all NOT RAW ATTR and METHOD addind NULL_POINTER_ERR Exception. Modified all NOT RAW ATTR and METHOD of Node derived interfaces adding INVALID_STATE_ERR Exception. Added IMPLEMENTATION element to gdome_xxx_unref * libgdome/gdome-events.h (GdomeEventType) Added * libgdome/events/gdome-evt-event.[ch] (struct _Gdome_evt_Event) added etype field (gdome_evt_evnt_mkref) Modified to add etype field initialization * libgdome/events/gdome-evt-mevent.[ch] (struct _Gdome_evt_MutationEvent) added etype field (gdome_evt_mevnt_mkref) Modified to add etype field initialization * libgdome/events/gdome-evt-eventl.c (gdome_evt_evntl_handleEvent) Bug Fix * libgdome/events/gdome-evt-util.h (GDOME_XML_IS_EVNT) Implemented (GDOME_XML_IS_MEVNT) Implemented * libgdome/events/gdome-xml-util.h All macros modified * libgdome/gdome-util.[ch] (gdome_cast_evnt) added (gdome_cast_mevnt) added * libgdome/gdome-events.h (GDOME_EVNT) added (GDOME_MEVNT) added 2001-11-19 Paolo Casarini * libgdome/gdome-treegc.[ch] (gdome_treegc_isDetached) added to finds nodes that are in detached subtrees (gdome_treegc_countLiveNodes) added to count referenced node in a detached subtree (gdome_treegc_addRef) modified to handle NOTATION, ENTITY nodes and nodes owned by detached subtree (gdome_treegc_delRef) modified to handle NOTATION, ENTITY nodes and nodes owned by detached subtree (gdome_treegc_removeSubtree) added to decrease main doc livenodes value when a subtree is removed. (gdome_treegc_removeSubtree) added to increase main doc livenodes value when a subtree is inserted. (gdome_treegc_adjust) added to adjust main doc livenodes value. * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_unref) Modified to free libxml2 underling structures if a node is the root of a detached subtree. (gdome_xml_n_appendChild) now also calls gdome_treegc_insertSubtree (gdome_xml_n_insertBefore) now also calls gdome_treegc_insertSubtree and gdome_treegc_removeSubtree (gdome_xml_n_removeChild) now also calls gdome_treegc_removeSubtree * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_removeAttribute) now it doesn't free the directly free the removed attribute, but gdome_xml_n_unref does it if needed. (gdome_xml_el_removeAttributeNS) now it doesn't free the directly free the removed attribute, but gdome_xml_n_unref does it if needed. * libgdome/gdomecore/gdome-xml-nnodem.c (gdome_xml_nnm_removeNamedItem) now also calls gdome_treegc_removeSubtree and gdome_treegc_adjust if needed. (gdome_xml_nnm_removeNamedItemNS) now also calls gdome_treegc_removeSubtree and gdome_treegc_adjust if needed. (gdome_xml_nnm_setNamedItem) now also calls gdome_treegc_insertSubtree and gdome_treegc_removeSubtree if needed. (gdome_xml_nnm_setNamedItemNS) not also calls gdome_treegc_insertSubtree and gdome_treegc_removeSubtree if needed. * test/test-document.c * test/test-namednodemap.c * test/test-treegc.c Modified to follow new treegc features * libgdome/gdomecore/Makefile.am Modified to compile also gdome-xml-xmlmemory.[ch] * libgdome/gdomecore/gdome-xml-xmlmemory.[ch] (gdome_xmlFreeSubtree) Added to free libxml2 subtree enabling GDOME_INVALID_STATE_ERR exception. CVS Added: gdome-xml-xmlmemory.[ch] 2001-11-07 Paolo Casarini * test/apigen/apigen.c * test/apigen/util.c * test/test-element.c * test/namednodemap.c * test/examplea.c * test/exampleb.c * test/examplec.c Added stdio.h in includes * test/test-cdata.c Removed parser.h from includes Replaced all !xmlStrEqual with strcmp * test/test-document.c Removed parser.h from includes Added string.h in includes Replaced all !xmlStrEqual with strcmp Replaced all XML_ costants with corresponding GDOME_ ones * test/test-dtd.c Removed parser.h from includes Replaced all !xmlStrEqual with strcmp * test/test-node.c Removed parser.h from includes Added string.h in includes Replaced all !xmlStrEqual with strcmp Replaced all XML_ costants with corresponding GDOME_ ones * libgdome/gdome.h Removed libxml/tree.h from includes * libgdome/events/gdome-evt-events.h Added tree.h in includes * libgdome/gdome.h * libgdome/gdome-events.h Removed from every _Gdome... structs the vtab field * libgdome/gdomecore/gdome-xml-node.h * libgdome/gdomecore/gdome-xml-attribute.h * libgdome/gdomecore/gdome-xml-cdata.h * libgdome/gdomecore/gdome-xml-cdatas.h * libgdome/gdomecore/gdome-xml-comment.h * libgdome/gdomecore/gdome-xml-document.h * libgdome/gdomecore/gdome-xml-documentf.h * libgdome/gdomecore/gdome-xml-documentt.h * libgdome/gdomecore/gdome-xml-domimpl.h * libgdome/gdomecore/gdome-xml-element.h * libgdome/gdomecore/gdome-xml-entity.h * libgdome/gdomecore/gdome-xml-entityref.h * libgdome/gdomecore/gdome-xml-nnodem.h * libgdome/gdomecore/gdome-xml-node.h * libgdome/gdomecore/gdome-xml-nodel.h * libgdome/gdomecore/gdome-xml-notation.h * libgdome/gdomecore/gdome-xml-pi.h * libgdome/gdomecore/gdome-xml-text.h Added in _Gdome_xml_... structs added the vtab field * libgdome/gdomecore/gdome-evt-event.h * libgdome/gdomecore/gdome-evt-eventl.h * libgdome/gdomecore/gdome-evt-mevent.h Added in _Gdome_evt_... structs added the vtab field * libgdome/gdomecore/gdome-xml-node.c * libgdome/gdomecore/gdome-xml-nodel.c * libgdome/gdomecore/gdome-xml-nnodem.c * libgdome/gdomecore/gdome-xml-document.c * libgdome/gdomecore/gdome-xml-documentt.c * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_xml_XXX_mkref) Modified to follow the vtab field * libgdome/gdomecore/gdome-evt-event.c * libgdome/gdomecore/gdome-evt-eventl.c * libgdome/gdomecore/gdome-evt-mevent.c (gdome_evt_XXX_mkref) Modified to follow the vtab field and added the reset for super.user_data field * libgdome/gdome-treegc.c (gdome_treegc_delRef) Modified to fix a memory leak 2001-11-05 Paolo Casarini * libgdome/events/gdome-evt-propagation.c (add_timestamp) replaced gettimeofday with g_get_current_time patch from Tobias Peters * Makefile.am (EXTRA_DIST) added gdome-config.1 * gdome2.spec.in (%doc) added gdome-config.1 * test/Makefile Added test-treegc.c test program * libgdome/gdomecore/gdome-xml-domimpl.c Added gdome-treegc.h in includes (gdome_xml_di_createDocument) Modified to fix a bug related to the treegc with regard to DocumentType * libgdome/gdomecore/gdome-xml-documentt.c (gdome_xml_dt_mkref) Modified to fix a bug related to the treegc (gdome_xml_dt_unref) Modified to fix a bug related to the treegc * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_unref) Modified to fix a bug related to the treegc * libgdome/gdomecore/gdome-xmldtdutil.c (notationDeallocator) Modified to fix a memory bug related to the Notation Nodes implemetation at the gdome2 layer CVS Added gdome-config.1 (made by Enrico Zini) Added test/test-treegc.c 2001-10-23 Paolo Casarini * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_xml_di_hasFeature) Modified to return TRUE for "Events" and "MutationEvents" modules. * libgdome/gdome.h (gdome_xml_n_mkref) declaration moved in gdome-xml-node.h (gdome_xml_from_document) declaration removed (gdome_xml_n_get_xmlNode) declaration moved in gdome-xml-node.h * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_from_document) removed 2001-10-22 Paolo Casarini * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_mkref) added the call to the treegc module and added the different call to manage GdomeDocument nodes (gdome_xml_n_unref) added the call to the treegc module (gdome-treegc.h) in includes * libgdome/gdomecore/gdome-xml-document.[ch] (gdome_xml_doc_mkref) added (gdome_xml_doc_unref) added (Gdome_xml_Document) added the field livenodes of type int to hold tree garbage collector information (gdome_xml_doc_vtab) gdome_xml_n_unref replaced with gdome_xml_doc_unref * libgdome/gdomecore/gdome-xml-documentt.c (gdome_xml_dt_mkref) added the call to the treegc module (gdome_xml_dt_unref) added the call to the treegc module * test/examplea.c Added two gdome_n_unref to free result reference Updated to the new memory management system * test/exampleb.c Added gdome_nl_unref to free childs reference Added gdome_el_unref to free root reference Updated to the new memory management system * test/examplec.c Added gdome_el_unref to free rootel reference Updated to the new memory management system * test/test-loadsave.c Removed glib.h from includes Updated to the new memory management system * test/test-nodelist.c Removed glib.h from includes Added gdome_nl_unref to free the last nl reference Added gdome_n_node to free node reference Updated to the new memory management system * test/test-dtd.c Removed glib.h from includes Added some gdome_xxx_unref to free some zombie references Updated to the new memory management system * test/test-cdata.c Very old gdome2 style programming Removed gdome_xml_str.h from includes Added many gdome_xxx_unref to free some zombie references Updated to the new memory management system * libgdome/gdomecore/gdome-xml-text.c (gdome_xml_t_splitText) Lost references bug fix * libgdome/gdomecore/gdome-xml-nnodem.c (gdome_xml_nnm_setNamedItem) Lost references bug fix (gdome_xml_nnm_setNamedItemNS) Lost references bug fix (gdome_xml_nnm_removeNamedItem) Lost references bug fix (gdome_xml_nnm_removeNamedItemNS) Lost references bug fix * test/test-document.c Added many gdome_xxx_unref to free some zombie references Updated to the new memory management system * test/test-element.c Added many gdome_xxx_unref to free some zombie references Updated to the new memory management system * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_removeAttributeNode) Lost reference bug fix * test/test-mevents.c Added many gdome_xxx_unref to free some zombie references Added many removeEventListener to free some zombie references Updated to the new memory management system * test/test-namednodemap.c Added many gdome_xxx_unref to free some zombie references Updated to the new memory management system CVS Added gdome-treegc.[ch] 2001-10-02 Paolo Casarini * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_getAttribute) modified to be compliant to DOM2 spec (gdome_xml_el_getAttributeNS) modified to be compliant to DOM2 spec * test/test-element.c Modified to follow Element.getAttribute and Element.getAttributeNS changes * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_ownerDocument) modified to be compliant to DOM2 spec 2001-08-06 Paolo Casarini * configure.in Added in AC_OUTPUT gdome2.spec.in (by Andrew Hughes Chatman) Prepared for 0.6.9 * Makefile.am Added in EXTRA_DIST gdome2.spec * libgdome/gdomecore/gdome-xml-domimpl.c Removed "extern int xmlDoValidityCheckingDefaultValue;" * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_hasChildNodes) Bug Fix CVS Added gdome2.spec.in 2001-06-13 Paolo Casarini * gtk-doc/Makefile.am install-data-local fix: now ignore errors * COPYING.LIB Changed the license from GPL to LGPL: to make this change I asked the consent to previous Gdome2 authors (Raph Levien, Daniel Veillard, Mathieu Lacage, Anders Carlson). See the mailing list archive. * *.[ch] Changed the license in the start of each source file from GPL to LGPL 2001-06-08 Paolo Casarini * libgdome/gdome.[ch] (GdomeExceptionCode) bug fix * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_di_createDocument) Added GDOME_WRONG_DOCUMENT_ERR check * gtk-doc/tmpl/... Added short and long description to Entity, EntityReference, NamedNodeMap, Node, NodeList, Notation, ProcessingInstruction, Text, EventListener, Event and MutationEvent interfaces. Updated Documentation 2001-05-30 Paolo Casarini * libgdome/gdomecore/gdome-xml-str.c (gdome_xml_str_ref) Added g_return... check on paramenter (gdome_xml_str_unref) Added g_return... check on paramenter * test/Makefile.am Added bench.c CVS Added: test/bench.c 2001-05-27 Paolo Casarini *libgdome/gdomecore/gdome-xml-str.[ch] (gdome_xml_str_ieEmpty) added *libgdome/gdome.[ch] (gdome_str_isEmpty) added HTML Documentation Added short e long description to Attr, CharacterData, CDATASection, Comment, Document, DocumentFragment, DocumentType, DOMImplementation, Element interfaces * libgdome/gdome.[ch] (GdomeLoadingMode) added GDOME_LOAD_SUBSTITUTE_ENTITIES (gdome_di_createDoc...) changed the type of parameter mode from GdomeLoadindMode to unsigned int to add the entities substitution capability. * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_di_createDoc...) changed the type of parameter mode from GdomeLoadindMode to unsigned int to add the entities substitution capability. (gdome_xml_di_createDocFromXXXXWithEntitiesTable) Fixed SAX memory leak * test/test-loadsave.c Modified to test the GDOME_LOAD_SUBSTITUTE_ENTITIES flag CVS TREE Added in gtk-doc/tmpl: attribute.sgml, documentf.sgml, entityref.sgml, mevent.sgml, pi.sgml, cdata.sgml, documentt.sgml, etypes.sgml, nnodem.sgml, text.sgml, cdatas.sgml, domimpl.sgml, event.sgml, node.sgml, types.sgml, comment.sgml, element.sgml, eventl.sgml, nodel.sgml, document.sgml, entity.sgml, gdome2-unused.sgml, notation.sgml. 2001-05-24 Paolo Casarini * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_xml_di_createDocFromURIWithEntitiesTable) Bug Fix (gdome_xml_di_createDocFromMemoryWithEntitiesTable) Bug Fix * libgdome/gdome.[ch] Changed the return value of all gdome_xxx_query_interface prototypes from void * to gpointer * libgdome/gdome-events.[ch] Changed the return value of all gdome_xxx_query_interface prototypes from void * to gpointer (gdome_evntl_mkref) changed the type of priv field from void * to gpointer (gdome_evntl_get_priv) changed the return value from coid * to gpointer * libgdome/events/gdome-evt-eventl.h (struct _Gdome_evt_EventListener) changed type of field priv from void* to gpointer * libgdome/gdomecore/gdome-xml-str.[ch] Removed old functions Changed in all function mapped by public API the type void* to gpointer Updated Documentation 2001-05-23 Paolo Casarini * libgdome/gdome.h * libgdome/gdome-events.h * libgdome/gdome-util.h * libgdome/gdome-refdebug.h * libgdome/gdome-private-list.h Added extern "C" {} block when _cplusplus is defined * libgdome/gdome.h * libgdome/gdome-events.h CHANGED THE TYPE OF THE user_data field FROM GdomePrivateList TO gpointer TO ALL PUBLIC OBJECT STRUCTURES Updated documentation 2001-05-23 Paolo Casarini * libgdome/gdomecore/gdome-xml-xmldtdutil (notationDeallocator) bug fix to be compiled with libxml 2.3.9 * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_getAttributeNode) bug fix * libgdome/gdome.[ch] (GdomeEntitiesTableEntry) added (gdome_di_createDocFromURIWithEntityTable) renamed in gdome_di_createDocFromURIWithEntitiesTable (gdome_di_createDocFromMemoryWithEntityTable) renamed in gdome_di_createDocFromMemoryWithEntitiesTable (gdome_di_createDocFromURIWithEntitiesTable) (gdome_di_createDocFromMemoryWithEntitiesTable) changed the field type of entityTable from gchar [][4] to const GdomeEntitiesTableEntry[] (gdome_str_equalIgnoreCase) added (gdome_str_charAt) added (gdome_str_concat) added (gdome_str_endsWith) added (gdome_str_length) added (gdome_str_startsWith) added * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_di_createDocFromURIWithEntityTable) renamed in gdome_xml_di_createDocFromURIWithEntitiesTable (gdome_xml_di_createDocFromMemoryWithEntityTable) renamed in gdome_xml_di_createDocFromMemoryWithEntitiesTable (gdome_xml_di_createDocFromURIWithEntitiesTable) (gdome_xml_di_createDocFromMemoryWithEntitiesTable) changed the field type of entityTable from gchar* [][4] to const GdomeEntitiesTableEntry[] * test/tes-loadsave.c Modified to follow changes in DOMImplementation interface * libgdome/gdomecore/gdome-xml-str.[ch] (gdome_xml_str_equalIgnoreCase) added (gdome_xml_str_charAt) added (gdome_xml_str_concat) added (gdome_xml_str_endsWith) added (gdome_xml_str_length) added (gdome_xml_str_startsWith) added * configure.in Prepared for release 0.6.8 Updated Documentation 2001-05-22 Paolo Casarini * libgdome/gdome.h (GDOME_A) Casting Marco added (GDOME_CD) Casting Marco added (GDOME_CDS) Casting Marco added (GDOME_C)) Casting Marco added (GDOME_DOC) Casting Marco added (GDOME_DF) Casting Marco added (GDOME_DT) Casting Marco added (GDOME_EL) Casting Marco added (GDOME_ENT) Casting Marco added (GDOME_ER) Casting Marco added (GDOME_N) Casting Marco added (GDOME_NOT) Casting Marco added (GDOME_PI) Casting Marco added (GDOME_T) Casting Marco added (GDOME_EVNTT) Casting Marco added * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_xml_di_ref) added g_return assert to check parameters (gdome_xml_di_unref) added g_return assert to check parameters * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_attributes) added g_return assert to check parameters (gdome_xml_el_getAttribute) added g_return assert to check parameters (gdome_xml_el_getAttributeNode) added g_return assert to check parameters (gdome_xml_el_getElementsByTagName) added g_return assert to check parameters (gdome_xml_el_getElementsByTagNameNS) added g_return assert to check parameters (gdome_xml_el_getAttributeNS) added g_return assert to check parameters (gdome_xml_el_getAttributeNodeNS) added g_return assert to check parameters (gdome_xml_el_hasAttribute) added g_return assert to check parameters (gdome_xml_el_hasAttributeNS) added g_return assert to check parameters * libgdome/gdomecore/gdome-xml-nnodem.c (gdome_xml_nnm_ref) added g_return assert to check parameters (gdome_xml_nnm_unref) added g_return assert to check parameters (gdome_xml_nnm_length) added g_return assert to check parameters (gdome_xml_nnm_getNamedItem) added g_return assert to check parameters (gdome_xml_nnm_getNamedItemNS) added g_return assert to check parameters (gdome_xml_nnm_item) added g_return assert to check parameters * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_ref) added g_return assert to check parameters (gdome_xml_n_unref) added g_return assert to check parameters (gdome_xml_n_) added g_return assert to check parameters (gdome_xml_n_) added g_return assert to check parameters (gdome_xml_n_) added g_return assert to check parameters (gdome_xml_n_) added g_return assert to check parameters * libgdome/gdomecore/gdome-xml-nodel.c (gdome_xml_nl_ref) added g_return assert to check parameters (gdome_xml_nl_unref) added g_return assert to check parameters (gdome_xml_nl_length) added g_return assert to check parameters (gdome_xml_nl_item) added g_return assert to check parameters CVS TREE Added: gdome-util.[ch] 2001-05-20 Paolo Casarini * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_di_saveDocToFile) added (gdome_xml_di_saveDocToMemory) added * libgdome/gdome.[ch] Renamed field private to user_data in all object structures (gdome_di_saveDocToFile) added (gdome_di_saveDocToMemory) added * libgdome/gdome-events.h Renamed field private to user_data in all object structures * libgdome/gdomecore/gdome-xml-documentt.c (gdome_xml_dt_mkref) modified to follow private field name * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_mkref) modified to follow private field name * test/examplea.c * test/exampleb.c * test/examplec.c * test/test-document.c * test/test-node.c Modified to follow save API changes * configure.in Prepared for 0.6.7 Updated dodumentation 2001-05-19 Paolo Casarini * libgdome/gdomecore/gdome-xml-attribute.c * libgdome/gdomecore/gdome-xml-cdata.c * libgdome/gdomecore/gdome-xml-documentt.c * libgdome/gdomecore/gdome-xml-element.c * libgdome/gdomecore/gdome-xml-entity.c * libgdome/gdomecore/gdome-xml-nnodem.c * libgdome/gdomecore/gdome-xml-node.c * libgdome/gdomecore/gdome-xml-nodel.c * libgdome/gdomecore/gdome-xml-notation.c * libgdome/gdomecore/gdome-xml-pi.c * libgdome/gdomecore/gdome-xml-text.c * libgdome/gdomecore/gdome-xml-util.c * libgdome/events/gdome-evt-event.c * libgdome/events/gdome-evt-eventl.c * libgdome/events/gdome-evt-mevent.c (gdome-util.h) removed from include * libgdome/gdomecore/gdome-xml-documentt.c (gdome_xml_dt_internalSubset) implemented * libgdome/Makefile.am (gdome-util.[ch]) removed * libgdome/gdomecore/Makefile.am (gdome-xml-util.c) removed * libgdome/events/Makefile.am (gdome-evt-util.c) added * libgdome/gdomecore/gdome-xml-util.h (gdome_xml_cast_node) removed (gdome_xml_cast_el) removed (gdome_xml_cast_evntt) removed (gdome_xml_cast_evntl) removed (GDOME_XML_IS_EVNTT) moved in gdome-evt-util.h (GDOME_XML_IS_EVNTL) moved in gdome-evt-util.h (GDOME_XML_IS_EVNT) moved in gdome-evt-util.h (GDOME_XML_IS_MEVNT) moved in gdome-evt-util.h * test/test-dtd.c Added test for gdome_dt_internalSubset CVS TREE Removed libgdome/gdome-util.[ch], libgdome/gdomecore/gdome-xml-util.c Added libgdome/events/gdome-evt-util.h 2001-05-19 Paolo Casarini * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_importNode) Bug Fix handling GDOME_ATTRIBUTE_NODE * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_cloneNode) Bug Fix handling GDOME_ATTRIBUTE_NODE 2001-05-16 Paolo Casarini * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_createEvent) added the support for "Events" eventType * libgdome/gdome-events.[ch] (struct _GdomeMutationEvent) added "private" field (struct _GdomeEvent) added "private" field (struct _GdomeEventListener) added "private" field (gdome_evntl_get_priv) added - Deprecated function - * libgdome/gdomecore/gdome-evt-evntl.[ch] (gdome_evt_evntl_get_priv) commented 2001-05-15 Paolo Casarini * libgdome/gdomecore/gdome-xml-node.c (addEventListener) bug fix in EventListener reference counting (removeEventListener) bug fix in EventListener reference counting * libgdome/events/gdome-evt-propagation.c (invokeListeners) bug fix in EventListener reference counting * libgdome/gdomecore/gdome-xml-node.[ch] (gdome_xml_n_canAppend) added - used for GDOME_HIERARCHY_REQUEST_ERR (gdome_xml_n_appendChild) added check for GDOME_HIERARCHY_REQUEST_ERR (gdome_xml_n_insertBefore) added check for GDOME_HIERARCHY_REQUEST_ERR (gdome_xml_n_replaceChild) added check for GDOME_HIERARCHY_REQUEST_ERR (gdome_xml_n_set_prefix) bug fix in prefix check * libgdome/gdome.[ch] (gdome_xxx_canAppend) added * libgdome/gdomecore/gdome-xml-nnodem.h (struct _Gdome_xml_NamedNodeMap) Changed the type of field "type" from gint to GdomeNodeType (GDOME_XML_NNM_LIST) removed (GDOME_XML_NNM_HASH) removed * libgdome/gdomecore/gdome-xml-nnodem.c (gdome_xml_nnm_mkref) changed parameter type of "type" from gint to GdomeNodeType, added increasing of reference counting for elem, changed the check to distinguish the type of the nnm from specific gint to GdomeNodeType (gdome_xml_nnm_unref) added decreasing of referecen counting for doc and elem (gdome_xml_nnm_length) modified to distinguish on node type (gdome_xml_nnm_getNamedItem) modified to distinguish on node type (gdome_xml_nnm_getNamedItemNS) modified to distinguish on node type (gdome_xml_nnm_item) modified to distinguish on node type (gdome_xml_nnm_removeNamedItem) modified to distinguish on node type (gdome_xml_nnm_removeNamedItemNS) modified to distinguish on node type (gdome_xml_nnm_setNamedItem) modified to distinguish on node type, added GDOME_GDOME_HIERARCHY_REQUEST_ERR (see DOM-Level-2-errata core-4) (gdome_xml_nnm_setNamedItemNS) modified to distinguish on node type added GDOME_GDOME_HIERARCHY_REQUEST_ERR (see DOM-Level-2-errata core-4) * libgdome/gdomecore/gdome-xml-documentt.c (gdome_xml_dt_entities) modified to follow changes in gdome_xml_nnm_mkref (gdome_xml_dt_notations) modified to follow changes in gdome_xml_nnm_mkref * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_attributes) modified to follow changes in gdome_xml_nnm_mkref (gdome_xml_el_removeAttribute) modified to follow changes in gdome_xml_nnm_mkref (gdome_xml_el_getAttributeNode) modified to follow changes in gdome_xml_nnm_mkref (gdome_xml_el_setAttributeNode) modified to follow changes in gdome_xml_nnm_mkref (gdome_xml_el_removeAttributeNode) modified to follow changes in gdome_xml_nnm_mkref (gdome_xml_el_removeAttributeNodeNS) modified to follow changes in gdome_xml_nnm_mkref (gdome_xml_el_getAttributeNodeNS) modified to follow changes in gdome_xml_nnm_mkref (gdome_xml_el_setAttributeNodeNS) modified to follow changes in gdome_xml_nnm_mkref 2001-05-13 Paolo Casarini * libgdome/gdomecore/gdome-xml-domimpl.[ch] Renamed all functions from gdome_xml_DOMImplementation_xxx to gdome_xml_di_xxx * libgdome/gdome.[ch] Renamed all functions from gdome_DOMImplementation_xxx to gdome_di_xxx (GdomeLoadingCode) added (gdome_di_createDocFromURI) added (gdome_di_createDocFromMemory) added (gdome_di_createDocFromURIWithEntityTable) added (gdome_di_createDocFromMemoryWithEntityTable) added * gtk-doc/gdome2-sections.txt * test/apigen/core.xml * test/examplea.c * test/exampleb.c * test/examplec.c * test/test-cdata.c * test/test-document.c * test/test-dtd.c * test/test-element.c * test/test-mevents.c * test/test-namednodemap.c * test/test-node.c * test/test-nodelist.c * test/apigen/apigen.c * libgdome/gdomecore/gdome-xml-document.c * libgdome/gdomecore/gdome-xml-node.c Updated to follow changes of DOMImplementation Inteface APIs * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_childNodes) hierarchy bug fix (gdome_xml_n_firstChild) hierarchy bug fix (gdome_xml_n_lastChild) hierarchy bug fix (gdome_xml_n_mkref) hierarchy bug fix (gdome_xml_n_unref) hierarchy bug fix (gdome_xml_n_dispatchEvent) modified to return the right value * libgdome/gdomecore/gdome-xml-documentt.c (config.h) added in include (gdome-refdebug.h) added in include (gdome_xml_dt_mkref) modifed to add reference counting debug (gdome_xml_dt_unref) modifed to add reference counting debug * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_removeAttribute) SegFault BUG FIX (gdome_xml_el_removeAttributeNS) SegFault BUG FIX * test/test-mevents.c Adde tests on DOMAttrModified events * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_xml_di_createDocFromURI) added (gdome_xml_di_createDocFromMemory) added (gdome_xml_di_createDocFromURIWithEntityTable) added (gdome_xml_di_createDocFromMemoryWithEntityTable) added * libgdome/refdebug.[ch] (GDOME_REFDBG_NODELIST) added (GDOME_REFDBG_NAMEDNODEMAP) added (GDOME_REFDBG_EVENTLISTENER) added * libgdome/events/gdome-evt-eventl.c (config.h) added in include (gdome-refdebug.h) added in include (gdome_evt_evntl_mkref) modified to add reference counting debug (gdome_evt_evntl_unref) modified to add reference counting debug * libgdome/events/gdome-xml-nodel.c (config.h) added in include (gdome-refdebug.h) added in include (gdome_xml_nl_mkref) modified to add reference counting debug (gdome_xml_nl_unref) modified to add reference counting debug * libgdome/events/gdome-xml-nnodem.c (config.h) added in include (gdome-refdebug.h) added in include (gdome_xml_nnm_mkref) modified to add reference counting debug (gdome_xml_nnm_unref) modified to add reference counting debug * test/apigen/core.xml (gdome_di_createDocFromURI) added (gdome_di_createDocFromMemory) added (gdome_di_createDocFromURIWithEntityTable) added (gdome_di_createDocFromMemoryWithEntityTable) added * gtk-doc Update Documentation * test/exampleb.c * test/examplec.c * test/test-document.c * test/test-dtd.c * test/test-document.c * test/test-element.c * test/test-mevents.c * test/test-namednodemap.c * test/test-node.c * test/test-nodelist.c Modified to use new DOMImplementation APIs * test/Makefile.am Added test-loadsave test program * configure.in Prepared for 0.6.6 CVS ADD test/test-loadsave.c, test/test-loadsave1.xml, test/test-loadsave2.xml 2001-05-09 Paolo Casarini * libgdome/Makefile.am Added gdome-refdebug.[ch] * configure.in Added with-ref-debug flag to include reference counting module * libgdome/gdomecore/gdome-xml-node.c (config.h) added in include (gdome_xml_n_mkref) modified to add reference counting debug (gdome_xml_n_unref) modified to add reference counting debug (gdome_xml_n_removeChild) modified the order of dispatching (gdome_xml_n_insertBefore) modified the order of dispatching * libgdome/gdomecore/gdome-evt-event.c.c (config.h) added in include (gdome_evt_evnt_mkref) modified to add reference counting debug (gdome_evt_evnt_unref) modified to add reference counting debug * libgdome/gdomecore/gdome-evt-mevent.c (config.h) added in include (gdome_evt_mevnt_mkref) modified to add reference counting debug (gdome_evt_mevnt_unref) modified to add reference counting debug * libgdome/gdomecore/gdome-xml-str.c (config.h) added in include (gdome_xml_str_mkref) modified to add reference counting debug (gdome_xml_str_mkref_own) modified to add reference counting debug (gdome_xml_str_mkref_xml) modified to add reference counting debug (gdome_xml_str_mkref_dup) modified to add reference counting debug (gdome_xml_str_const_unref) modified to add reference counting debug (gdome_xml_str_unref_own) modified to add reference counting debug (gdome_xml_str_unref_xml) modified to add reference counting debug * libgdome/events/gdome-evt-propagation.c (fireEvent) bug fix in capturing and bubbling phase * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_xml_DOMImplementation_createDocument) refcnt bug fix * test/Makefile.am Added test-mevents test program * gtk-doc/Makefile.am (EXTRA_DIST) added events html files CVS TREE Added: libgdome/gdome-refdebug.[ch], acconfig.h, test/test-mevents.c, test/test-mevents.xml 2001-05-06 Paolo Casarini * libgdome/events/gdome-evt-eventl.[ch] Added doumentation comments to all functions (gdome_evt_evntl_handleEvent) modified the prototype * libgdome/events/gdome-evt-event.[ch] (gdome_evt_evnt_currentTarget) modified the prototype (gdome_evt_evnt_target) modified the prototype * libgdome/events/gdome-evt-event.[ch] (gdome_evt_mevnt_unref) bug fix (gdome_evt_mevnt_query_interface) added (gdome_evt_mevnt_vtab) modified * libgdome/gdome-events.h (gdome_evnt_currentTarget) modified the prototype (gdome_evntl_handleEvent) modified the prototype (gdome_evnt_target) modified the prototype (gdome_mevnt_attrChange) added (GdomePhaseType) added (GdomeAttrChangeType) added * libgdome/gdome-events.c Added Comments * test/apigen/apigen.c Bug Fix * test/apigen/srcutil.c (writeMethod) added implementation for function params (writeCheck) added implementation for GdomeDOMTimeStamp * libgdome/gdomecore/gdome-xml-attribute.c * libgdome/gdomecore/gdome-xml-cdata.c * libgdome/gdomecore/gdome-xml-element.c * libgdome/gdomecore/gdome-xml-nnodem.c * libgdome/gdomecore/gdome-xml-node.c * libgdome/gdomecore/gdome-xml-pi.c * libgdome/gdomecore/gdome-xml-text.c Bug fix using gdome_evt_mevnt_unref * libgdome/gdome.h (struct _GdomeNamedNodeMapVtab) removed (struct _GdomeNodeListVtab) removed (struct _GdomeDOMImplementationVtab) removed (struct _GdomeNodeVtab) removed (struct _GdomeCharacterDataVtab) removed (struct _GdomeTextVtab) removed (struct _GdomeCDATASectionVtab) removed (struct _GdomeCommentVtab) removed (struct _GdomeDocumentVtab) removed (struct _GdomeDocumentFragmentVtab) removed (struct _GdomeDocumentTypeVtab) removed (struct _GdomeAttrVtab) removed (struct _GdomeElementVtab) removed (struct _GdomeEntityVtab) removed (struct _GdomeEntityReferenceVtab) removed (struct _GdomeNotationVtab) removed (struct _GdomeProcessingInstructionVtab) removed * libgdome/gdome.c * test/apigen/core.xml (libxml/hash.h) added in include (gdome-xml-nnodem.h) added in include (gdome-xml-nodel.h) added in include (gdome-xml-domimpl.h) added in include (gdome-xml-node.h) added in include (gdome-xml-cdata.h) added in include (gdome-xml-text.h) added in include (gdome-xml-cdatas.h) added in include (gdome-xml-comment.h) added in include (gdome-xml-document.h) added in include (gdome-xml-documentf.h) added in include (gdome-xml-documentt.h) added in include (gdome-xml-attribute.h) added in include (gdome-xml-element.h) added in include (gdome-xml-entity.h) added in include (gdome-xml-entityref.h) added in include (gdome-xml-notation.h) added in include (gdome-xml-pi.h) added in include * libgdome/gdomecore/gdome-xml-nnodem.h (struct _GdomeNamedNodeMapVtab) added * libgdome/gdomecore/gdome-xml-nodel.h (struct _GdomeNodeListVtab) added * libgdome/gdomecore/gdome-xml-domimpl.h (struct _GdomeDOMImplementationVtab) added * libgdome/gdomecore/gdome-xml-node.h (struct _GdomeNodeVtab) added * libgdome/gdomecore/gdome-xml-cdata.h (struct _GdomeCharacterDataVtab) added * libgdome/gdomecore/gdome-xml-cdata.h (struct _GdomeTextVtab) added * libgdome/gdomecore/gdome-xml-cdatas.h (struct _GdomeCDATASectionVtab) added * libgdome/gdomecore/gdome-xml-comment.h (struct _GdomeCommentVtab) added * libgdome/gdomecore/gdome-xml-document.h (struct _GdomeDocumentVtab) added * libgdome/gdomecore/gdome-xml-documentf.h (struct _GdomeDocumentFragmentVtab) added * libgdome/gdomecore/gdome-xml-documentt.h (struct _GdomeDocumentTypeVtab) added * libgdome/gdomecore/gdome-xml-attribute.h (struct _GdomeAttributeVtab) added * libgdome/gdomecore/gdome-xml-element.h (struct _GdomeElementVtab) added * libgdome/gdomecore/gdome-xml-entity.h (struct _GdomeEntityVtab) added * libgdome/gdomecore/gdome-xml-entityref.h (struct _GdomeEntityReferenceVtab) added * libgdome/gdomecore/gdome-xml-notation.h (struct _GdomeNotationVtab) added * libgdome/gdomecore/gdome-xml-pi.h (struct _GdomeProcessingInstructionVtab) added * test/test-node.c * test/test-dtd.c * test/test-document.c All API calls changed from vtabs style to C API style * gtk-doc/Makefile.am Added gdome-events.h to scan * gtk-doc/gdome2-sections.txt * gtk-doc/gdome2-docs.sgml Added Events Documentation CVS TREE Added: test/apigen/events.xml gtk-doc/html/gdome2-events-basic-types-and-enumerations.html gtk-doc/html/gdome2-events.html gtk-doc/html/gdome2-gdomeevent.html gtk-doc/html/gdome2-gdomeeventlistener.html gtk-doc/html/gdome2-gdomemutationevent.html 2001-05-04 Paolo Casarini * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_DOMImplementation_saveFormatFile) changed the prototype * libgdome/gdomecore/gdome-xml-document.[ch] (gdome_xml_doc_createEvent) added * libgdome/gdome.[ch] (gdome_DOMImplementation_saveFormatFile) changed the prototype (gdome_xml_mut_invoke_listener) removed (struct _GdomeNodeVtab) added subTreeDispatchEvent (gdome_n_subTreeDispatchEvent) added (gdome_el_subTreeDispatchEvent) added (gdome_a_subTreeDispatchEvent) added (gdome_cd_subTreeDispatchEvent) added (gdome_t_subTreeDispatchEvent) added (gdome_cds_subTreeDispatchEvent) added (gdome_c_subTreeDispatchEvent) added (gdome_doc_subTreeDispatchEvent) added (gdome_dt_subTreeDispatchEvent) added (gdome_df_subTreeDispatchEvent) added (gdome_ent_subTreeDispatchEvent) added (gdome_er_subTreeDispatchEvent) added (gdome_not_subTreeDispatchEvent) added (gdome_pi_subTreeDispatchEvent) added (struct _GdomeDocumentVtab) added createEvent (gdome_doc_createEvent) added * test/apigen/core.xml Changed the prototype of the saveFormatFile METHOD in DOMImplmentation Interface. Added createEvent in Document Interface and subTreeDispatchEvent in Node Interface. * configure.in Prepared for 0.6.5 release * libgdome/gdomecore/gdome-xml-node.[ch] (gdome_xml_n_invoke_listener) removed (gdome_xml_mut_invoke_listener_recursive) removed (add_timestamp) removed (gdome_xml_n_invoke_listener_prop) removed (gdome_xml_mut_invoke_listener_recursive) removed (gdome_xml_n_subTreeDispatchEvent) commented * gtk-doc Documentation on Core module updated 2001-05-03 Paolo Casarini * libgdome/gdomecore/gdome-xml-pi.c (gdome_xml_pi_set_data) mopdified to dispatch of DOMSubTreeModified and the check for GDOME_NO_MODIFICATION_ALLOWED_ERR (gdome_xml_pi_query_interface) added and implemented * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_set_nodeValue) modified to forward the call to more specific API (gdome_xml_n_appendChild) modifed to dispatch DOMNodeInserted, DOMInsertedIntoDocument and DOMSubTreeModified (gdome_xml_n_insertBeforeChild) modifed to dispatch DOMNodeInserted, DOMInsertedIntoDocument, DOMSubTreeModified, DOMNodeRemovedFromDocument and DOMNodeRemoved (gdome_xml_n_removeChild) modifed to dispatch DOMSubTreeModified, DOMNodeRemovedFromDocument and DOMNodeRemoved (gdome_xml_n_query_interface) modified and commented * libgdome/gdomecore/gdome-xml-cdata.[ch] (gdome_xml_n_set_data) modified to dispatch of DOMSubTreeModified and DOMCharacterDataModified (gdome_xml_cd_appendData) modified to dispatch of DOMSubTreeModified and DOMCharacterDataModified (gdome_xml_cd_deleteData) modified to dispatch of DOMSubTreeModified and DOMCharacterDataModified (gdome_xml_cd_insertData) modified to dispatch of DOMSubTreeModified and DOMCharacterDataModified (gdome_xml_cd_replaceData) modified to dispatch of DOMSubTreeModified and DOMCharacterDataModified (gdome_xml_cd_query_interface) implemented * libgdome/gdomecore/gdome-xml-attribute.[ch] (gdome_xml_a_set_value) modified to dispatch of DOMAttrModified and DOMSubTreeModified (gdome_xml_a_query_interface) bug fix (gdome_xml_a_ownerElement) bug fix (gdome_xml_a_query_interface) modified and commented * libgdome/gdomecore/gdome-xml-nnodem.c (gdome_xml_nnm_removeNamedItem) modifed to dispatch DOMAttrModified and DOMSubTreeModified (gdome_xml_nnm_removeNamedItemNS) modifed to dispatch DOMAttrModified and DOMSubTreeModified (gdome_xml_nnm_setNamedItem) modifed to dispatch DOMAttrModified and DOMSubTreeModified (gdome_xml_nnm_setNamedItemNS) modifed to dispatch DOMAttrModified and DOMSubTreeModified * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_setAttribure) modifed to dispatch DOMAttrModified and DOMSubTreeModified (gdome_xml_el_setAttribureNS) modifed to dispatch DOMAttrModified and DOMSubTreeModified (gdome_xml_el_removeAttribute) modified tests on params (gdome_xml_el_removeAttributeNS) modified tests on params (gdome_xml_el_setAttributeNode) modified tests on params (gdome_xml_el_setAttributeNodeNS) modified tests on params (gdome_xml_el_removeAttributeNode) modified tests on params (gdome_xml_el_query_interface) added and implemented * libgdome/gdomecore/gdome-xml-text.c (gdome_xml_t_splitText) modifed to dispatch DOMNodeInserted and DOMSubTreeModified (gdome_xml_t_query_interface) added and implemented * libgdome/gdomecore/gdome-xml-cdatas.[ch] (gdome_xml_cds_query_interface) added and implemented * libgdome/gdomecore/gdome-xml-comment.[ch] (gdome_xml_c_query_interface) added and implemented * libgdome/gdomecore/gdome-xml-document.[ch] (gdome_xml_doc_query_interface) added and implemented * libgdome/gdomecore/gdome-xml-documentf.[ch] (gdome_xml_df_query_interface) added and implemented * libgdome/gdomecore/gdome-xml-documentt.[ch] (gdome_xml_dt_query_interface) added and implemented * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_DOMImplementation_query_interface) implemented * libgdome/gdomecore/gdome-xml-entity.[ch] (gdome_xml_ent_query_interface) added and implemented * libgdome/gdomecore/gdome-xml-entityref.[ch] (gdome_xml_er_query_interface) added and implemented * libgdome/gdomecore/gdome-xml-notation.[ch] (gdome_xml_not_query_interface) added and implemented * lingdome/gdomecore/gdome-xml-util.h (GDOME_XML_IS_C) implemented (GDOME_XML_IS_CDS) implemented (GDOME_XML_IS_DF) implemented (GDOME_XML_IS_ER) implemented * libgdome/gdome.h (GdomeEventTarget) added (GdomeDocumentEvent) added 2001-04-29 Paolo Casarini * test/test-nodelist.c Bug fix * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_addEventListener) modified (gdome_xml_n_removeListener) implemented (gdome_xml_n_dispatchEvent) implemented (gdome_xml_n_subTreeDispatchEvent) added - no standard (gdome_xml_n_appendChild) modified event's implementation * libgdome/gdomecore/gdome-evt-propagation.c (gdome_evt_invokeListeners) modified to handle removal (gdome_evt_fireEvent) modified * libgdome/events/gdome-evt-mevnt.c (gdome_evt_mevnt_initMutationEvent) modified * libgdome/gdome-events.h (GdomeEventException) added (GdomeEventExceptionCode) added * libgdome/events/gdome-evt-event.c (gdome_evt_evnt_preventDefault) bug fix. 2001-04-27 Paolo Casarini * libgdome/events/Makefile.am Modified to follow CVS TREE changes * libgdome/gdome-events.[ch] (struct _GdomeEventListenerVtab) moved in libgdome/events/gdome-evt-eventl.h (struct _GdomeEventVtab) moved in libgdome/events/gdome-evt-event.h (struct _GdomeMutationEventVtab) moved in libgdome/events/gdome-evt-mevent.h Modified to follow events file changes * libgdome/events/gdome-evt-eventl.[ch] (struct _GdomeEventListenerVtab) added (struct _Gdome_xml_EventListenerPriv) removed (struct _Gdome_xml_EventListener) added struct _Gdome_xml_EventListenerPriv fields Implementation of the EventListener Interface * libgdome/events/gdome-evt-event.[ch] (struct _GdomeEventVtab) added (struct _Gdome_xml_EventPriv) removed (struct _Gdome_xml_Event) added struct _Gdome_xml_EventPriv fields Implementation of the Event Interface * libgdome/events/gdome-evt-mevent.[ch] (struct _GdomeMutationEventVtab) added (struct _Gdome_xml_MutationEventPriv) removed (struct _Gdome_xml_MutationEvent) added struct _Gdome_xml_MutationEventPriv fields Implementation of the MutationEvent Interface * libgdome/gdomecore/gdome-xml-comment.h (#include "gdome-xml-eventl.h") removed, useless * libgdome/gdomecore/gdome-xml-node.c * libgdome/gdomecore/gdome-xml-util.[ch] * libgdome/Makefile.am * libgdome/gdome-events.c Modified to follow events file changes * libgdome/gdomecore/gdome-xml-node.c (gdome_n_cloneNode) modified comment and implementation * libgdome/gdomecore/gdome-xml-document.c (gdome_doc_importNode) modified comment and implementation (gdome_doc_createEvent) added * libgdome/gdomecore/gdome-xml-pi.c (gdome_xml_pi_set_data) bug fix and added Events * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_DOMImplementation_saveFormatFile) added CVS TREE Added: libgdome/events/gdome-evt-propagation.[ch] Moved: libgdome/events/gdome-xml-event.c to libgdome/events/gdome-evt-event.c libgdome/events/gdome-xml-event.h to libgdome/events/gdome-evt-event.h libgdome/events/gdome-xml-eventl.c to libgdome/events/gdome-evt-eventl.c libgdome/events/gdome-xml-eventl.h to libgdome/events/gdome-evt-eventl.h libgdome/events/gdome-xml-mevent.c to libgdome/events/gdome-evt-mevent.c libgdome/events/gdome-xml-mevent.h to libgdome/events/gdome-evt-mevent.h 2001-04-25 Paolo Casarini * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_importNode) bug fix * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_mkref) bug fix in the init of the Gdome_xml_Node structure (gdome_xml_vtabs) bug fix for entity reference nodes * libgdome/gdomecore/gdome-xml-documentt.c (gdome_xml_dt_mkref) bug fix in the init of the Gdome_xml_DocumentType structure * Makefile.am (SUBDIRS) Added gtk-doc * gtk-doc/Makefile.am (EXTRA_DIST) added * test/test-cdata.c All API calls changed from vtabs style to C API style * configure.in Prepared for 0.6.4 CVS TREE Added: gtk-doc/html gtk-doc/html/book1.html gtk-doc/html/gdome2-basic-types-and-enumerations.html gtk-doc/html/gdome2-core.html gtk-doc/html/gdome2-gdomeattr.html gtk-doc/html/gdome2-gdomecdatasection.html gtk-doc/html/gdome2-gdomecharacterdata.html gtk-doc/html/gdome2-gdomecomment.html gtk-doc/html/gdome2-gdomedocument.html gtk-doc/html/gdome2-gdomedocumentfragment.html gtk-doc/html/gdome2-gdomedocumenttype.html gtk-doc/html/gdome2-gdomedomimplementation.html gtk-doc/html/gdome2-gdomeelement.html gtk-doc/html/gdome2-gdomeentity.html gtk-doc/html/gdome2-gdomeentityreference.html gtk-doc/html/gdome2-gdomenamednodemap.html gtk-doc/html/gdome2-gdomenode.html gtk-doc/html/gdome2-gdomenodelist.html gtk-doc/html/gdome2-gdomenotation.html gtk-doc/html/gdome2-gdomeprocessinginstruction.html gtk-doc/html/gdome2-gdometext.html gtk-doc/html/index.sgml 2001-04-24 Paolo Casarini * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_importNode) Bug Fix * libgdome/gdomecore/gdome-xml-nodel.c (gdome_xml_nl_mkref) Added gdome_xml_n_ref(root, &exc) (gdome_xml_nk_unref) Added gdome_xml_n_unref(root, &exc) * test/test-nodelist.c Modified to test all attribute, methods and liveness * test/Makefile.am Modified to compile test-nodelist.c and test-namednodemap.c * test/apigen/Makefile.am removed "copying" from EXTRA_DIST * configure.in Prepared for 0.6.3 CVS Added: test/test-namednodemap.c test-namednodemap.xml 2001-04-22 Paolo Casarini * libgdome/gdomecore/gdome-xml-attribute.c * libgdome/gdomecore/gdome-xml-cdata.c * libgdome/gdomecore/gdome-xml-document.c * libgdome/gdomecore/gdome-xml-documentt.c * libgdome/gdomecore/gdome-xml-domimpl.c * libgdome/gdomecore/gdome-xml-element.c * libgdome/gdomecore/gdome-xml-entity.c * libgdome/gdomecore/gdome-xml-nnodem.c * libgdome/gdomecore/gdome-xml-node.c * libgdome/gdomecore/gdome-xml-nodel.c * libgdome/gdomecore/gdome-xml-notation.c * libgdome/gdomecore/gdome-xml-pi.c * libgdome/gdomecore/gdome-xml-str.c * libgdome/gdomecore/gdome-xml-text.c * libgdome/gdomecore/gdome-xml-xmldtdutil.c * libgdome/gdomecore/gdome-xml-xmlutil.c Modified some comments to respect gtk-doc rules * libgdome/gdome.h (GdomeExceptionCode) Added GDOME_NULL_POINTER_ERR (gdome_nnm_getNamedItemNS) Added prototype (gdome_nnm_setNamedItemNS) Added prototype (gdome_nnm_removeNamedItemNS) Added prototype -Added the old field private (GdomePrivateList*) to all the interface struts -Some Bugs Fix * libgdome/gdome-private-list.[ch] Some little changes and added comments * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_DOMImplementation_createDocumentType) Bug fix (gdome_DOMImplementation_createDocumentType) Bug fix * configure.in * libgdome/gdome.[ch] * libgdome/gdome-util.h * libgdome/Makefile.am * lingdome/gdomecore/Makefile.am Modified to follow "events" directory creation CVS TREE Added: libgdome/gdome-events.[ch] libgdome/events libgdome/events/Makefile.am test/apigen test/apigen/Makefile.am test/apigen/apigen.c test/apigen/core.xml test/apigen/srcutil.c test/apigen/srcutil.h test/apigen/util.c test/apigen/util.h gtk-doc gtk-doc/Makefile.am gtk-doc/gdome2-docs.sgml gtk-doc/gdome-sections.txt Moved in libgdome/events: libgdome/gdomecore/gdome-xml-event.[ch] libgdome/gdomecore/gdome-xml-mevent.[ch] libgdome/gdomecore/gdome-xml-eventl.[ch] 2001-04-12 Paolo Casarini * test/Makefile.am * test/examplea.c * test/exampleb.c * test/examplec.c * test/test-document.c * test/test-dtd.c * test/test-element.c * test/test-node.c Modified work fine with distcheck * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_setAttribute) Memory Bug Fix (thanx to Laurent Lemaitre) * configure.in (GDOME_INCLUDEDIR) bug fix * libgdome/gdomecore/gdome-xml-domimpl.c Modified some comments 2001-04-12 Paolo Casarini * libgdome/gdomecore/gdome-xml-attribute.c * libgdome/gdomecore/gdome-xml-document.c * libgdome/gdomecore/gdome-xml-documentf.c * libgdome/gdomecore/gdome-xml-documentt.c * libgdome/gdomecore/gdome-xml-element.c * libgdome/gdomecore/gdome-xml-event.c * libgdome/gdomecore/gome-xml-eventl.c * libgdome/gdomecore/gome-xml-mevent.c * libgdome/gdomecore/gdome-xml-node.c * libgdome/gdomecore/gdome-xml-nodel.c * libgdome/gdomecore/gdome-xml-str.c * libgdome/gdomecore/gdome-xml-util.c deleted #include * configure.in Deleted check for GTK libraries (GDOME_INCLUDEDIR) Added GLIB,LIBXML and -I${includedir}/libgdome (GDOME_LIBS) Added GLIB and LIBXML Prepared for release 0.6.2 * gnome-config.in (the_libs) Added GLIB (the_flags) Added GLIB and -I$includedir/libgdome * libgdome/Makefile.am * test/Makefile.am * libgdome/gdomecore/Makefile.am * libgdome/gdomehtml/Makefile.am Now include GLIB and not GTK * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_importNode) bug fix (thanx to rob) * test/test-element.c (test_el) bug fix * test/Makefile.am Now support the test suites * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_DOMImplementation_parseFile) renamed field filename in uri (gdome_xml_DOMImplementation_validateFile) renamed field filename in uri * libgdome/gdomecore/gdome-xml-str.[ch] (gdome_xml_str_dup) changed type for field str from gchar to const gchar * libgdome/gdome.[ch] (gdome_DOMImplementation_parseFile) renamed field filename in uri (gdome_DOMImplementation_validateFile) renamed field filename in uri (gdome_str_dup) changed type for field str from gchar to const gchar CVS TREE Added test/examplec.c test/examplec.xml 2001-03-26 Paolo Casarini * configure.in: prepared for release 0.6.1 * test/Makefile.am Added EXTRA_DIST for xml and dtd data files Removed test-gdome.c, test-events, test-nodelist * test/test-document.c Added test for the existence of input files * test/test-dtd.c * test/test-element.c * test/test-node.c Added test for the existence of input file 2001-03-25 Paolo Casarini * libgdome/gdome.h (GdomeNodeType) added * configure.in: require libxml2-2.3.5 CVS TREE Added: test/examplea.c, test/exampleb.c test/exampleb.xml test/test-element.c test/test-element.xml Deleted: STATE 2001-03-25 Paolo Casarini * libgdome/gdome.[ch] (gdome_str_mkref) added (gdome_str_mkref_own) added (gdome_str_mkref_dup) added (gdome_str_ref) added (gdome_str_equal) added * libgdome/gdomecore/gdome-xml-str.[ch] (gdome_xml_str_equal) modified * Makefile.am: 0.6.0 * configure.in:0.6.0 * Makefile.am, README, config.h.in, configure.in, gdome-config.in, gdomeConf.sh.in, libgdome/Makefile.am, ligdome/gdomecore/Makefile.am Prepared for release 0.6.0 * gdome-xml-documentt.c, gdome-xml-node.c bug fix * Test Programs: bug fix 2001-03-23 Paolo Casarini * libgdome/gdomecore/gdome-xml-node.[ch] (gdome_xml_n_normalize) modified (gdome_xml_n_supports) renamed in gdome_xml_n_supports (gdome_xml_n_isSupported) implemented (gdome_xml_n_vtab) updated (gdome_xml_n_set_prefix) modified to manage GDOME_NAMESPACE_ERR * libgdome/gdomecore/gdome-xml-attribute.c (gdome_xml_a_vtab) updated * libgdome/gdomecore/gdome-xml-documentf.c (gdome_xml_df_vtab) updated * libgdome/gdomecore/gdome-xml-cdata.c (gdome_xml_cd_vtab) updated * libgdome/gdomecore/gdome-xml-cdatas.c (gdome_xml_cds_vtab) updated * libgdome/gdomecore/gdome-xml-comment.c (gdome_xml_c_vtab) updated * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_vtab) updated * libgdome/gdomecore/gdome-xml-documentt.c (gdome_xml_dt_vtab) updated * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_vtab) updated * libgdome/gdomecore/gdome-xml-entity.c (gdome_xml_ent_vtab) updated * libgdome/gdomecore/gdome-xml-entityref.c (gdome_xml_er_vtab) updated * libgdome/gdomecore/gdome-xml-notation.c (gdome_xml_not_vtab) updated * libgdome/gdomecore/gdome-xml-pi.c (gdome_xml_pi_vtab) updated * libgdome/gdomecore/gdome-xml-text.c (gdome_xml_t_vtab) updated * libgdome/gdome.[ch] "supports" method renamed in "isSupported" in all intefaces Added to all gdome2 API check for "self != NULL" * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_xml_DOMImplementation_hasFeature) implemented (gdome_xml_DOMImplementation_createDocument) modified to manage GDOME_NAMESPACE_ERR (gdome_xml_DOMImplementation_createDocumentType) modified to manage GDOME_NAMESPACE_ERR * libgdome/gdomecore/gdome-xml-document.[ch] (gdome_xml_doc_vtab) updated (gdome_xml_doc_importNode) added (gdome_xml_doc_createAttributeNS) modified to manage GDOME_NAMESPACE_ERR (gdome_xml_doc_createElementNS) modified to manage GDOME_NAMESPACE_ERR * libgdome/gdomecore/gdome-xml-element.c (gdome_setAttributeNS) modified to manage GDOME_NAMESPACE_ERR 2001-03-22 Paolo Casarini * libgdome/gdome.h * libgdome/gdomecore/gdome-xml-attribute.h (GdomeAccessType accessType) added to struct Gdome_xml_Attribute * libgdome/gdomecore/gdome-xml-cdata.h (GdomeAccessType accessType) added to struct Gdome_xml_CharacterData * libgdome/gdomecore/gdome-xml-cdatas.h (GdomeAccessType accessType) added to struct Gdome_xml_CDATASection * libgdome/gdomecore/gdome-xml-comment.h (GdomeAccessType accessType) added to struct Gdome_xml_Comment * libgdome/gdomecore/gdome-xml-document.h (GdomeAccessType accessType) added to struct Gdome_xml_Document * libgdome/gdomecore/gdome-xml-documentf.h (GdomeAccessType accessType) added to struct Gdome_xml_DocumentFragment * libgdome/gdomecore/gdome-xml-documentt.h (GdomeAccessType accessType) added to struct Gdome_xml_DocumentType * libgdome/gdomecore/gdome-xml-element.h (GdomeAccessType accessType) added to struct Gdome_xml_Element * libgdome/gdomecore/gdome-xml-entity.h (GdomeAccessType accessType) added to struct Gdome_xml_Entity * libgdome/gdomecore/gdome-xml-entityref.h (GdomeAccessType accessType) added to struct Gdome_xml_EntityReference * libgdome/gdomecore/gdome-xml-node.h (GdomeAccessType accessType) added to struct Gdome_xml_Node * libgdome/gdomecore/gdome-xml-notation.h (GdomeAccessType accessType) added to struct Gdome_xml_Notation * libgdome/gdomecore/gdome-xml-pi.h (GdomeAccessType accessType) added to struct Gdome_xml_ProcessingInstruction * libgdome/gdomecore/gdome-xml-text.h (GdomeAccessType accessType) added to struct Gdome_xml_Text * libgdome/gdomecore/gdome-xml-nodel.[ch] (GdomeAccessType accessType) added to struct Gdome_xml_Nodelist (gdome_xml_nl_mkref) modified to manage readonly * libgdome/gdomecore/gdome-xml-nnodem.[ch] (gboolean isReadonly) deleted (GdomeAccessType accessType) added to struct Gdome_xml_NamedNodeMap (gdome_xml_nnm_mkref) modified to manage readonly (gdome_xml_nnm_removeNamedItem) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_nnm_removeNamedItemNS) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_nnm_setNamedItem) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_nnm_setNamedItemNS) modified to manage NO_MODIFICATION_ALLOW_ERR * libgdome/gdomecore/gdome-xml-util.h (GDOME_ISREADONLY) added * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_mkref) modified to manage readonly (gdome_xml_n_ref) modified (gdome_xml_n_unref) modified (gdome_xml_n_childNodes) modified to manage readonly (gdome_xml_n_setNodeValue) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_n_setPrefix) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_n_appendChild) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_n_insertBefore) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_n_removeChild) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_n_replaceChild) modified to manage NO_MODIFICATION_ALLOW_ERR * libgdome/gdomecore/gdome-xml-attr.c (gdome_xml_a_set_value) modified to manage NO_MODIFICATION_ALLOW_ERR * libgdome/gdomecore/gdome-xml-cdata.c (gdome_xml_cd_set_data) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_cd_appendData) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_cd_deleteData) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_cd_insertData) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_cd_replaceDat) modified to manage NO_MODIFICATION_ALLOW_ERR * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_getElementById) modified to manage readonly (gdome_xml_doc_getElementsByTagName) modified to manage readonly (gdome_xml_doc_getElementsByTagNameNS) modified to manage readonly * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_xml_DOMImplementation_parseFile) modified (gdome_xml_DOMImplementation_validateFile) modified * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_attributes) modified to manage readonly (gdome_xml_el_getAttribute) bug fix (gdome_xml_el_setAttribute) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_el_removeAttribute) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_el_setAttributeNode) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_el_removeAttributeNode) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_el_getAttributeNS) bug fix (gdome_xml_el_setAttributeNS) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_el_removeAttributeNS) modified to manage NO_MODIFICATION_ALLOW_ERR (gdome_xml_el_setAttributeNodeNS) modified to manage NO_MODIFICATION_ALLOW_ERR * libgdome/gdomecore/gdome-xml-text.c (splitText) modified to manage NO_MODIFICATION_ALLOW_ERR * libgdome/gdomecore/gdome-xml-documentt.c (gdome_xml_dt_mkref) modified manage readonly (gdome_xml_dt_entities) modified to manage readonly (gdome_xml_dt_notations) modified to manage readonly 2001-03-18 Paolo Casarini * libgdome/gdome.h (GdomeExceptionCode) added (GdomeAccessType) added * libgdome/gdomecore/gdome-xml-node.[ch] (gdome_xml_n_mkref) modified for XML_ENTITY_DECL (gdome_xml_n_nodeName) modified for XML_ENTITY_DECL (gdome_xml_vtabs[]) modified for XML_ENTITY_DECL (gdome_xml_n_nodeType) modified for XML_ENTITY_DECL (gdome_xml_n_nodeValue) modified for XML_ENTITY_DECL deleted doc field in _Gdome_xml_Node struct (gdome_xml_n_mkref) modified for XML_DTD_NODE * libgdome/gdomecore/gdome-xml-util.h (GDOME_XML_IS_N) XML_ENTITY_DECL added (GDOME_XML_IS_ENT) implemented (GDOME_XML_IS_NOT) added * libgdome/gdomecore/gdome-xml-entity.[ch] (struct _Gdome_xml_Entity) changed type for n (xmlNode* to xmlEntity*) (gdome_xml_ent_publicId) implemented (gdome_xml_ent_systemId) implemented (gdome_xml_ent_notationName) implemented * libgdome/gdomecore/gdome-xml-entityref.[ch] Implementation of EntityReference Interface * libgdome/gdomecore/gdome-xml-element.[ch] deleted doc field in _Gdome_xml_Node struct (gdome_xml_el_attributes) updated (gdome_xml_el_removeAttribute) updated (gdome_xml_el_getAttributeNode) updated (gdome_xml_el_setAttributeNode) updated (gdome_xml_el_removeAttributeNode) updated (gdome_xml_el_removeAttributeNodeNS) updated (gdome_xml_el_getAttributeNodeNS) updated (gdome_xml_el_setAttributeNodeNS) updated * libgdome/gdomecore/gdome-xml-xmldtdutil.[ch] (gdome_xmlNotation) implemented (gdome_xmlNotattionsHashCreate) implemented (gdome_xmlNotattionsHashFree) implemented (gdome_xmlEntitiesHashCreate) implemented (gdome_xmlEntitiesHashFree) implemented * libgdome/gdomecore/gdome-xml-documentt.[ch] Added to _Gdome_xml_DocumentType struct: -Gdome_xml_ListenerList *ll -xmlHashTable *entities (to hold xmlEntity structs) -xmlHashTable *notations (to hold gdome_xmlNotation structs) (gdome_xml_dt_mkref) added (gdome_xml_dt_unref) added (gdome_xml_dt_notations) updated (gdome_xml_dt_entities) updated * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_docType) updated * test/test-dtd.[c|xml|dtd] Added tests for Notations and Entities. CVS TREE Added: libgdome/gdomecore/gdome-xml-entityref.[ch] libgdome/gdomecore/gdome-xml-xmldtdutil.[ch] 2001-03-14 Paolo Casarini * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_DOMImplementation_createDocumentType) modified (gdome_xml_DOMImplementation_validateFile) added * libgdome/gdomecore/gdome-xml-documentt.[ch] Renamed field "dt" in "n" in struct _Gdome_xml_DocumentType (gdome_xml_dt_name) implemented (gdome_xml_dt_entities) implemented (gdome_xml_dt_notations) implemented (gdome_xml_dt_publicId) implemented (gdome_xml_dt_systemId) implemented * libgdome/gdomecore/gdome-xml-util.h (GDOME_XML_IS_DT) added (GDOME_XML_IS_CD) implemented (GDOME_XML_IS_T) implemented * libgdome/gdome.[ch] (gdome_xml_DOMImplementation_validateFile) added * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_doctype) implemented (gdome_xml_doc_createCDATASection) bug fix * libgdome/gdomecore/gdome-xml-cdatas.[ch] Implementation of CDATASection Interface * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_vtabs[]) added vtabs for CDATA_SECTION_NODE and DTD_NODE (gdome_xml_n_hasAttributes) bug fix (gdome_xml_n_nodeName) modified for XML_DTD_NODE, XML_PI_NODE (gdome_xml_n_nodeType) modified for XML_DTD_NODE (gdome_xml_n_nodeValue) modified for XML_DTD_NODE, XML_PI_NODE (gdome_xml_n_set_nodeValue) modified for XML_DTD_NODE, XML_PI_NODE * libgdome/gdomecore/gdome-xml-cdata.c (gdome_xml_cd_replaceData) bug fix * libgdome/gdomecore/gdome-xml-pi.[ch] (gdome_xml_pi_data) implemented (gdome_xml_pi_target) implemented (gdome_xml_pi_set_data) implemented * test/test-document. (test_document1) added test on CDATASection creation CVS TREE Added: libgdome/gdomecore/gdome-xml-cdatas.[ch] test/test-dtd.dtd test/test-dtd.xml test-dtd.c 2001-03-11 Paolo Casarini * libgdome/gdomecore/gdome-xml-cdata.c (gdome_utf16Length) added (helper function) (gdome_utf16Offset) added (helper function) (gdome_xml_cd_data) modified (gdome_xml_cd_set_data) modified (gdome_xml_cd_length) modified (gdome_xml_cd_appendData) modified (gdome_xml_cd_deleteData) modified (gdome_xml_cd_insertData) modified (gdome_xml_cd_replaceData) modified (gdome_xml_cd_substringData) modified * libgdome/gdomecore/gdome-xml-text.c (gdome_xml_t_splitText) modified * libgdome/gdomecore/gdome-xml-xmlutil.[ch] (gdome_xmlSetPrev) added (gdome_xmlSetNext) added (gdome_xmlSetLastChild) added (gdome_xmlGetPrevChild) renamed in gdome_xmlGetPrev (gdome_xmlGetNextChild) renamed in gdome_xmlGetNext * libgdome/gdomecore/gdome-xml-node.c Updated calls to gdome_xmlGet[Prev|Next]Child bug fix CVS TREE Added: test-cdata.c (test nodes bases on CharacterData) 2001-03-08 Paolo Casarini * libgdome/gdomecore/gdome-xml-xmlutil.[ch] (gdome_xmlSetAttrValue) added Like libxml xmlSetProp (gdome_xmlAppendChild) modified (gdome_xmlInsertBeforeChild) modified Modified to specialize the behavior for DocumentFragment nodes * libgdome/gdomecore/gdome-xml-attribute.c (gdome_xml_a_set_value) modified Now use gdome_xmlSetAttrValue * libgdome/gdomecore/gdome-xml-nnodem.c (gdome_xml_nnodem_mkref) bug fix * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_appendChild) bug fix * test/test-document.c (test_document1) bug fix * test/test-node.c Completely changed, now test all attributes and methods * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_DOMImplementation_freeDoc) added * libgdome/gdome.[ch] (gdome_DOMImplementation_freeDoc) added * CVS TREE added: test/test-node.xml used by test-node deleted: libgdome/gdomecore/gdome-xml-element-nnodem.[ch] useless 2001-03-06 Paolo Casarini * libgdome/gdomecore/gdome-xml-domimpl.[ch] (gdome_xml_DOMImplementation_parseFile) implemented (gdome_xml_DOMImplementation_saveFile) implemented (gdome_xml_DOMImplementation_createDocument) implemented * libgdome/gdomecore/gdome-xml-document.[ch] (gdome_xml_doc_createAttributeNS) implemented (gdome_xml_doc_createElementNS) implemented (gdome_xml_doc_getElementsByTagNameNS) implemented (gdome_xml_doc_getElementById) implemented (gdome_xml_doc_getElementsByTagName) modified (gdome_xml_doc_createEntityReference) modified (gdome_xml_doc_createAttribute) modified (gdome_xml_doc_createCDATASection) modified (gdome_xml_doc_createComment) modified (gdome_xml_doc_createDocumentFragment) modified (gdome_xml_doc_createElement) modified (gdome_xml_doc_createProcessingInstruction) modified (gdome_xml_doc_createTextNode) modified * libgdome/gdomecore/gdome-xml-nnodem.c bug fix in nodeIterator struct * libgdome/gdome.[ch] (gdome_DOMImplementation_parseFile) added (gdome_DOMImplementation_saveFile) added (gdome_DOMImplementation_mkref) added * libgdome/gdome-html.c (gdome_HTMLDocument_createAttributeNS) updated * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_mkref) bug fix * libgdome/gdomecore/gdome-xml-attribute.c (gdome_xml_a_value) bug fix * test -Modified: Makefile.am -Added files: test-document.c test-document2.xml test-document3.xml Test Document object and its methods, preorder traversal Nodelist and the new bootstrap mode in DOMImplementation. Create also a file named test-document1.xml. 2001-02-25 Paolo Casarini * libgdome/gdomecore/gdome-xml-xmlutil.[ch] (gdome_xmlGetPrevChild) implemented (gdome_xmlGetNextChild) implemented (gdome_xmlGetFirstChild) implemented (gdome_xmlGetLastChild) implemented (gdome_xmlGetNsPrefix) implemented (gdome_xmlGetType) implemented (gdome_xmlRemoveChild) implemented (gdome_xmlAppendChild) implemented (gdome_xmlInsertBeforeChild) implemented (gdome_xmlSetNs) implemented (gdome_xmlGetChildrenItem) implemented (gdome_xmlGetChildrensLength) implemented (gdome_xmlPreoderTraveral) replaced by gdome_xmlGetChildrenItem (gdome_xmlCntTreeNodes) replaced by gdome_xmlGetChildrensLength * libgdome/gdomecore/gdome-xml-node.[ch] "Attributes" (gdome_xml_n_attributes) modified (gdome_xml_n_childNodes) modified (gdome_xml_n_firstChild) updated (gdome_xml_n_lastChild) updated (gdome_xml_n_localName) implemented (gdome_xml_n_namespaceURI) modified (gdome_xml_n_nextSibling) updated (gdome_xml_n_nodeName) modified (gdome_xml_n_nodeType) updated (gdome_xml_n_nodeValue) modified (gdome_xml_n_ownerDocument) modified (gdome_xml_n_parentNode) modified (gdome_xml_n_prefix) updated (gdome_xml_n_previousSibling) updated (gdome_xml_n_set_nodeValue) modified (gdome_xml_n_set_prefix) implemented Methods (gdome_xml_n_appendChild) modified (gdome_xml_n_insertBeforeChild) modified (gdome_xml_n_hasAttributes) implemented (gdome_xml_n_hasChildNodes) modified (gdome_xml_n_cloneNode) modified (gdome_xml_n_removeChild) modified (gdome_xml_n_replaceChild) modified vtab (gdome_xml_n_hasAttributes) added * libgdome/gdomecore/gdome-xml-util.h GDOME_XML_IS_TREE_N added GDOME_XML_IS_A implemented GDOME_XML_IS_EL implemented * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_tagName) modified (gdome_xml_el_setAttributeNS) bug fix (gdome_xml_n_hasAttributes) added in vtab * libgdome/gdomecore/gdome-xml-attribute.[ch] (gdome_xml_a_nodeName) renamed in gdome_xml_a_name (gdome_xml_a_name) modified (gdome_xml_a_nodeValue) modified and renamed in gdome_xml_a_value (gdome_xml_a_set_nodeValue) modified and renamed in gdome_xml_a_set_value (gdome_xml_a_ownerElement) implemented vtab (gdome_xml_n_namespaceURI) added (gdome_xml_n_prefix) added (gdome_xml_n_set_prefix) added (gdome_xml_n_localName) added (gdome_xml_n_hasAttributes) added * libgdome/gdomecore/gdome-xml-cdata.c * libgdome/gdomecore/gdome-xml-comment.c * libgdome/gdomecore/gdome-xml-document.c * libgdome/gdomecore/gdome-xml-documentf.c * libgdome/gdomecore/gdome-xml-documentt.c * libgdome/gdomecore/gdome-xml-entity.c * libgdome/gdomecore/gdome-xml-notation.c * libgdome/gdomecore/gdome-xml-pi.c * libgdome/gdomecore/gdome-xml-text.c (gdome_xml_n_hasAttributes) added in vtab * libgdome/gdome.h (hasAttributes) added to _GdomeNodeVtab (ownerElement) added to _GdomeAttrVtab Added prototypes: gdome_n_hasAttributes, gdome_pi_hasAttributes, gdome_not_hasAttributes, gdome_er_hasAttributes, gdome_ent_hasAttributes, gdome_dt_hasAttributes, gdome_df_hasAttributes, gdome_doc_hasAttributes, gdome_c_hasAttributes, gdome_cds_hasAttributes, gdome_t_hasAttributes, gdome_el_hasAttributes, gdome_a_hasAttributes, gdome_el_hasAttributes, gdome_a_ownerElement. *libgdome/gdome.c Added implementations: gdome_n_hasAttributes, gdome_a_hasAttributes, gdome_cd_hasAttributes, gdome_t_hasAttributes, gdome_cds_hasAttributes, gdome_c_hasAttributes, gdome_doc_hasAttributes, gdome_df_hasAttributes, gdome_dt_hasAttributes, gdome_el_hasAttributes, gdome_ent_hasAttributes, gdome_er_hasAttributes, gdome_not_hasAttributes, gdome_pi_hasAttributes, gdome_a_ownerElement. 2001-02-20 Paolo Casarini * libgdome/gdomecore/gdome-xml-str.[ch] (gdome_xml_str_mkref_dup) implemented * libgdome/gdomecore/gdome-xml-xmlutil.[ch] (gdome_xmlPreorderTraversal) implemented (gdome_xmlNamedPreorderTraversal) implemented (gdome_xmlCntTreeNodes) implemented (gdome_xmlNamedCntTreeElemets) implemented * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_traversal_helper) deleted (obsolete) (gdome_xml_el_getElementsByTagName) modified to use the new NodeList (gdome_xml_el_getElementsByTagNameNS) implemented * libgdome/gdomecore/gdome-xml-nodel.[ch] (gdome_xml_nl_mkref) rewritten (gdome_xml_nl_unref) modified (gdome_xml_nl_item) rewritten (gdome_xml_nl_length) rewritten (gdome_xml_nl_append) deleted (obsolete) Completely changed * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_childNodes) modified to use the new NodeList * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_traversal_helper) deleted (obsolete) (gdome_xml_doc_getElementsByTagName) modified to use the new NodeList 2001-02-18 Paolo Casarini * libgdome/gdomecore/gdome-xml-xmlutil.[ch] Added the prefix gdome_ to all functions (gdome_xmlGetAttrList) implemented (gdome_xmlSetAttrList) implemented (gdome_xmlGetOwner) implemented (gdome_xmlSetOwner) implemented (gdome_xmlGetParent) implemented (gdome_xmlSetParent) implemented (gdome_xmlGetNsURI) implemented (gdome_xmlGetNs) implemented (gdome_xmlGetName) implemented (gdome_xmlGetAttr) implemented (gdome_xmlGetNsAttr) implemented (gdome_xmlUnlinkAttr) modified to use the new functions (gdome_xmlUnlinkNsAttr) modified to use the new functions (gdome_xmlLinkAttr) modified to use the new functions and bug fix * libgdome/gdomecore/gdome-xml-nnodem.c (gdome_xml_nnm_removeNamedItem) bug fix (gdome_xml_nnm_removeNamedItemNS) bug fix Most of method modified to use the new functions in module xmlutil * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_tagName) modified (gdome_xml_el_attributes) updated (gdome_xml_el_getAttributeNode) updated (gdome_xml_el_getAttributeNodeNS) updated (gdome_xml_el_removeAttributeNode) updated (gdome_xml_el_setAttributeNode) implemented (gdome_xml_el_setAttributeNodeNS) implemented (gdome_xml_el_getAttribute) updated (gdome_xml_el_setAttribute) added comment (gdome_xml_el_removeAttribute) modified (gdome_xml_el_getAttributeNS) updated (gdome_xml_el_setAttributeNS) modified (gdome_xml_el_removeAttributeNS) modified (gdome_xml_hasAttribute) modified (gdome_xml_hasAttributeNS) modified * libgdome/gdomecore/gdome-xml-str.[ch] (gdome_xml_str_equal) implemented (an utility function for tests) (gdome_xml_unref) implemented (gdome_xml_ref) implemented (gdome_xml_mkref) updated (gdome_xml_mkref_xml) implemented (gdome_xml_unref_xml) implemented (gdome_xml_mkref_own) updated (gdome_xml_unref_own) updated Added: -xml function that substitute xmlfree ones -global unref for all kind of GdomeDOMString -refcnt field * libgdome/gdome.h Added the field refcnt to the _GdomeDOMString struct Added GDOME_NAMESPACE_ERR * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_unref) bug fix 2001-02-14 Paolo Casarini * libgdome/gdomecore/Makefile.am Added gdome_xml_nnodem.[ch] and gdome_xml_xmlutil.[ch] Removed gdome_xml_element_nnodem.[ch] * libgdome/gdome.h Added GDOME_WRONG_DOCUMENT_ERR GDOME_NO_MODIFICATION_ALLOWED_ERR GDOME_INUSE_ATTRIBUTE_ERR * libgdome/gdomecore/gdome_xml_nnodem.h Fixed compilation error (#include ). * libgdome/gdomecore/gdome_xml_nnodem.c (gdome_xml_nnm_getNamedItemNS) bug fix * libgdome/gdomecore/gdome_xml_node.h Added a GdomeDocument ref in the Gdome_xml_Node struct. * libgdome/gdomecore/gdome_xml_node.c (gdome_xml_n_mkref) modified to inizialize the GdomeDocument ref in the Element Object. l* libgdome/gdomecore/gdome_xml_element.h Added a GdomeDocument ref in the Gdome_xml_Element struct. * libgdome/gdomecore/gdome_xml_node.c (gdome_xml_el_attributes) modified to return the new NamedNodeMap. (gdome_xml_el_getAttributeNode) modified using NamedNodeMap. (gdome_xml_el_getAttributeNodeNS) modified using NamedNodeMap. (gdome_xml_el_removeAttributeNode) modified using NamedNodeMap. * libgdome/gdomecore/gdome_xml_xmlutil.c (xmlUnlinkNsAttr) bug fix 2001-02-11 Paolo Casarini * libgdome/gdomecore/gdome-xml-xmlutil.c * libgdome/gdomecore/gdome-xml-xmlutil.h added, it's a module with the functions to works on gnome-xml tree structure. So if something change we have to modify only these function. (not added to the Makefile.am) * libgdome/gdomecore/gdome-xml-nnodem.c * libgdome/gdomecore/gdome-xml-nnodem.h (gome_xml_nnm_mkref) implemented. (gdome_xml_nnm_length) implemented. (gome_xml_nnm_getNamedItem) implemented. (gdome_xml_nnm_getNamedItemNS) implemented. (gdome_xml_nnm_item) implemented. (gdome_xml_nnm_removeNamedItem) implemented. (gdome_xml_nnm_removeNamedItemNS) implemented. (gdome_xml_nnm_setNamedItem) implemented. (gdome_xml_nnm_setNamedItemNS) implemented. This object map two kind of structure. It has to work with an xmlHashTable when is called by a DocumentType with the methods getNotations and getEntities, and with a list of xmlAttr when is called by an Element with the method getAttributes. (not added to the Makefile.am) * AUTHORS update 2000-11-06 Mathieu Lacage move to doc/ * ChangeLog.gdome1: * TODO: * Copyright: * doc/ChangeLog.gdome1: * STATE: more work on the state. * Makefile.am: fix make distcheck. * libgdome/Makefile.am: fix make distcheck. * libgdome/gdomehtml/Makefile.am: fix make distcheck. * libgdome/gdome-util.h: * libgdome/gdomecore/Makefile.am: * libgdome/gdomecore/gdome-util.c: * libgdome/gdomecore/gdome-util.h: * libgdome/gdomecore/gdome-xml-node.c: (gdome_xml_n_childNodes), (gdome_xml_n_removeChild), (gdome_xml_mut_invoke_listener_recursive): fix 2 or 3 bugs. Add test to show the bug in NodeList. * test/Makefile.am: * test/test-nodelist.c: (main): * test/test-nodelist.xml: Thu Oct 26 11:11:22 CEST 2000 Daniel Veillard * libgdome/gdomecore/gdome-xml-util.h: added missing definition for GDOME_XML_IS_DOC * libgdome/gdomecore/gdome-xml-element-nnodem.c: closed an unfinished comment * libgdome/gdomecore/gdome-xml-document.c: 3 missing local variable declarations 2000-10-26 Mathieu Lacage * AUTHORS: * MAINTAINERS: update. * QUERIES: * README.gdome1: move to doc/ * STATE: state of oimplementation. not finished. * configure.in: make gtk+/glib 2.0 compilation optional. * doc/QUERIES: * doc/README.gdome1: * doc/RaphDream: move there. * libgdome/gdomecore/gdome-xml-attribute.c: (gdome_xml_a_specified): * libgdome/gdomecore/gdome-xml-cdata.c: (gdome_xml_cd_data), (gdome_xml_cd_set_data), (gdome_xml_cd_length), (gdome_xml_cd_substringData): * libgdome/gdomecore/gdome-xml-cdata.h: * libgdome/gdomecore/gdome-xml-document.c: (gdome_xml_doc_doctype), (gdome_xml_doc_implementation), (gdome_xml_doc_documentElement), (gdome_xml_doc_createElement), (gdome_xml_doc_createDocumentFragment), (gdome_xml_doc_createTextNode), (gdome_xml_doc_createComment), (gdome_xml_doc_createCDATASection), (gdome_xml_doc_createProcessingInstruction), (gdome_xml_doc_createAttribute), (gdome_xml_doc_createEntityReference), (gdome_xml_doc_getElementsByTagName): * libgdome/gdomecore/gdome-xml-document.h: * libgdome/gdomecore/gdome-xml-element-nnodem.c: * libgdome/gdomecore/gdome-xml-element.c: (gdome_xml_el_setAttribute), (gdome_xml_el_getElementsByTagNameNS), (gdome_xml_el_hasAttribute): * libgdome/gdomecore/gdome-xml-node.c: (gdome_xml_n_nodeName), (gdome_xml_n_parentNode), (gdome_xml_n_childNodes): * libgdome/gdomecore/gdome-xml-nodel.h: add numerous FIXMEs, cleanup, change some error handling. * test/test-gdome.c: (test_el_structure): small fix. 2000-09-01 Anders Carlsson * libgdome/gdomecore/gdome-xml-util.h: Update to match libxml * libgdome/gdomecore/gdome-xml-node.c: Likewise. 2000-07-08 Anders Carlsson * libgdome/gdome-private-list.c (gdome_private_list_nth): New function. 2000-07-06 Anders Carlsson * libgdome/gdomecore/gdome-xml-mevent.c (gdome_xml_mevnt_vtab = ): Add declaration for gdome_xml_evnt_type in the vtab. * libgdome/gdomecore/gdome-xml-util.h (GDOME_XML_IS_N): Add HTML_DOCUMENT_NODE. 2000-07-04 Anders Carlsson * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_insertBefore): Emit correct events. (gdome_xml_n_replaceChild): Likewise. (gdome_xml_n_removeChild): Likewise. (gdome_xml_n_appendChild): Likewise. (gdome_xml_mut_invoke_listener_recursive): Function for traversing a node and emitting all its children's event listeners. * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_setAttribute): Emit correct events. * libgdome/gdomecore/gdome-xml-cdata.c (gdome_xml_cd_set_data): Emit events. (gdome_xml_cd_appendData): Likewise. (gdome_xml_cd_insertData): Likewise. (gdome_xml_cd_deleteData): Likewise. (gdome_xml_cd_replaceData): Likewise. * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_get_xmlnode): Add a function to get an xmlNode from a GdomeNode. * libgdome/gdome.h (gdome_xml_n_get_xmlNode): Add function declaration. 2000-07-03 Anders Carlsson * libgdome/gdomecore/gdome-xml-node.c (add_timestamp): Function for adding a timestamp to an event. (gdome_xml_n_invoke_listener): Call add_timestamp () (gdome_xml_n_invoke_listener_prop): Likewise. (gdome_xml_n_namespaceURI): Implement function. (gdome_xml_n_prefix): Implement function. * libgdome/gdomecore/gdome-xml-mevent.c (gdome_xml_mevnt_vtab = ): Add timestamp function. * libgdome/gdomecore/gdome-xml-event.h: Add timestamp variable to Gdome_xml_EventPriv structure. * libgdome/gdomecore/gdome-xml-event.c: Add timeStamp to vtable. (gdome_xml_evnt_timeStamp): Add function. * libgdome/gdome.h: Add typedef for GdomeDOMTimeStamp. Add timeStamp function to GdomeEvent's vtab. Several function declarations. * libgdome/gdome.c (gdome_evnt_timeStamp): Add function. (gdome_mevnt_timeStamp): Likewise. (gdome_uievnt_timeStamp): Likewise. * libgdome/gdome.h (gdome_xml_from_document): Move a public function declaration. 2000-07-01 Anders Carlsson * libgdome/gdomecore/gdome-xml-node.c: Update to match new HTML tree style in libxml2 (using XML_HTML_DOCUMENT_NODE) 2000-06-30 Anders Carlsson * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_addEventListener): Don't add duplicate event listeners. 2000-06-11 Anders Carlsson * libgdome/gdome.h: Add PrivateList pointer to all Gdome structures. This may not be needed, but it's easy to remove them later. 2000-06-08 Anders Carlsson * configure.in (XML_CONFIG): add XML_CONFIG for gdome-config.in script. * gdome-config.in: Make this work. * libgdome/gdome.h: Add private field to GdomeNode; * libgdome/gdomecore/gdome-xml-node.c (gdome_xml_n_mkref): Set private field to NULL. * libgdome/gdome-private-list.c: New file, used for a "private" list in GdomeNode for views etc. * libgdome/gdome-private-list.h: Likewise. * libgdome/Makefile.am: Add gdome-private-list.[ch] 2000-06-04 Jonas Borgström * configure.in: set XML_CONFIG="xml-config" as default. Or else it will not find the xml-config in the $PATH. * .cvsignore: Added gdome-config. 2000-06-04 Anders Carlsson * Makefile.am (bin_SCRIPTS): Install gdome-config. * configure.in (GDOME_LIBS): Create gdome-config. * gdome-config.in: New file. 2000-05-17 Anders Carlsson * libgdome/gdome.h: Change syntax. * libgdome/gdome.c (gdome_DOMImplementation_createDocumentType): Change syntax. * libgdome/gdome-html.c (gdome_HTMLDOMImplementation_createDocumentType): Change syntax. * libgdome/gdomecore/gdome-xml-domimpl.c (gdome_xml_DOMImplementation_createDocumentType): Implement, and change syntax due to changes in the DOM spec. * libgdome/gdomecore/gdome-xml-document.c (gdome_xml_doc_createDocumentFragment): Implement. (gdome_xml_doc_createComment): Likewise. (gdome_xml_doc_createCDATASection): Likewise. (gdome_xml_doc_createProcessingInstruction): Likewise. (gdome_xml_doc_createEntityReference): Likewise. 2000-05-16 Anders Carlsson * libgdome/gdomecore/gdome-xml-element.c (gdome_xml_el_getElementsByTagName): Implement. 2000-05-10 Anders Carlsson * libgdome/*.[ch]: Add LGPL headers. 2000-05-07 Anders Carlsson * libgdome/gdome-xml-document.c (gdome_xml_doc_implementation): Implement. * configure.in: Better (?) libxml check. * libgdome/Makefile.am: Added new files. * test/test-gdome.c (test_DOMImplementation): Added test case. * libgdome/gdome-xml-domimpl.[ch]: Added. 16/04/2000 Mathieu Lacage * libgdome/gdome-xml-entity.[hc]: added. * libgdome/gdome-xml-documentf.[hc]: added. * libgdome/gdome-xml-documentt.[hc]: added. * libgdome/gdome-xml-comment.[hc]: added. * libgdome/gdome-xml-pi.[hc]: added. * libgdome/gdome-xml-notation.[hc]: added. * libgdome/gdome-xml-node.c: added the other files in the Node vtable. * libgdome/Makefile.am: added new files for compilation. * autogen.sh: changed warning for raph. 16/04/2000 Mathieu Lacage * libgdome/*.[hc]: * Copyright: added. * COPYING.LIB: added. * AUTHORS: added myself. 16/04/2000 Mathieu Lacage * libgdome/gdome-xml-element.[hc] : finish sanity checks. - gdome_xml_el_hasAttribute. implement. - gdome_xml_el_hasAttributeNs. implement. 16/04/2000 Mathieu Lacage * libgdome/gdome-xml-element.[hc] : add new DOM2 method from the latest spec. * libgdome/gdome.[hc] : add new DOM2 method from the latest spec. Also, format code. 16/04/2000 Mathieu Lacage * libgdome/gdome-xml-element.c: - gdome_xml_el_getAttributeNS : implement. - gdome_xml_el_setAttributeNS : implement. - gdome_xml_el_removeAttributeNS : implement. - gdome_xml_el_getAttributeNodeNS : implement. - gdome_xml_el_setAttributeNodeNS : implement. Warning: the above 2 last implementations do not take into account the fact that the Attribute default value may be defined in the document DTD. It lacks code to search the DTD attributes first. (same for gdome_xml_el_getAttributeNode and gdome_xml_el_setAttributeNode) * libgdome/gdome-xml-nnodem.[hc]: mv gdome-xml-element-nnodem.[hc] The above name change will allow me to begin the implementation of some other stuff which must export some NamedNodeMap objects which don't have the same implementation of the NamedNodeMap object exported by Element. (namely, DocumentType for example) Also cleanups inside this thing : replace all xmlElement with xmlNode and all xmlAttribute with xmlAttr and all attributes with properties. 16/04/2000 Mathieu Lacage * ligdome/gdome-xml-element.c: my, god, I am plain stupid. I still wonder how the code I wrote worked... replace all xmlElement with xmlNode and all xmlAttribute with xmlAttr and all attributes with properties. 13/04/2000 Mathieu Lacage * libgdome/gdome-xml-nodel.c: implement gdome_xml_nl_query_interface. * libgdome/gdome-xml-document.c: implement - gdome_xml_doc_createAttribute. thanks to DV_ for xmlNewDocProp. * libgdome/gdome-xml-attribute.c: - gdome_xml_a_query_interface. implement. - gdome_xml_a_nodeName. implement. - all other functions. New sanity checks. * libgdome/gdome-xml-element.c: - gdome_xml_el_tagName. New sanity checks. - gdome_xml_el_getAttribute. New sanity checks. cleanups. - gdome_xml_el_setAttribute. New sanity checks. - gdome_xml_el_removeAttribute. New sanity checks. cleaner implementation. - gdome_xml_el_getAttributeNode. New sanity checks. cleaner implementation. - gdome_xml_el_setAttributeNode. New sanity checks. full implementation. - gdome_xml_el_removeAttributeNode. New sanity checks. - all other functions --> new sanity checks. cleanups. 05/04/2000 Mathieu Lacage * gdome2/ : mv gdome2 libgdome. cvs import. 04/04/2000 Mathieu Lacage * test/test-gdome.c : complete rewrite of the tests. focusing on the Element Node. * gdome2/gdome-xml-element.c : as a consequence of the tests, correct bugs, add some new ones and implement a lot of methods in Element. They do not support Events. - gdome_xml_el_removeAttribute. - gdome_xml_el_getAttributeNode : no test. - gdome_xml_el_setAttributeNode : no test. - gdome_xml_el_removeAttributeNode : no test. * gdome2/gdome-xml-document.c : implement some methods of the Document interface. - gdome_xml_doc_createTextNode. Fix the gdome_xml_from_document function: make it call the gdome_xml_n_mkref function. * configure.in : dump version to 0.5. eh: it still compiles !! /me becomes good programmer. 03/04/2000 Mathieu Lacage * gdome2/gdome-xml-str.[hc] : new files. str helper functions are there. * gdome2/gdome-xml-util.[hc], gdome2/gdome-util.[hc] implement the dynamic type-checking stuff we discused with Raph though the use of the macros: - GDOME_N - GDOME_EL - GDOME_EVNTT - GDOME_EVENL These macros rely on the GDOME_XML_IS_* macros which are defined in gdome-xml-util.h and called by the gdome_xml_cast_* functsion defined in gdome_xml_util.c. The whole thing is not very complex... Most of its overhead will disapear when compiling g_return_val_if_fail as no-op. * gdome2/*.h and *.c : need to cleanup the includes. Sanity checks are now uniform. All the parameters are tested against NULL with: if (self == NULL ) return NULL; int parameters are furthermore tested against their bounds. The type checking is made with g_return_*_if_fail. It still compiles !! I managed not to break compilation :) * gdome2/gdome-xml-doc.[hc] : rename. mv gdome-xml-doc gdome-xml-document * gdome2/gdome-xml-text.[hc] : new file. implement Text interface. * gdome2/gdome-xml-cdata.[hc] : new file. implement the CharacterData interface. * gdome2/gdome-xml-nnodem.[hc] : new file. implement the NamedNodeMap interface. * configure.in : dump version to 0.4. 02/04/2000 Mathieu Lacage * gdome2/gdome-xml.c : - gdome_xml_doc_createElement : implement using xmlNewDocNode. - gdome_xml_doc_documentElement : implement. The root Element of a document can be found using xmlDocGetRootElement. (Fuck, Daniel did a HUGE work !! I LOVE libxml2 !!!) - gdome_xml_from_document : implement. * gdome2/gdome-xml-doc.[hc], gdome2/gdome-xml-node.[hc], gdome2/gdome-xml-element.[hc], gdome2/gdome-xml-attribute.[hc], gdome2/gdome-xml-event.[hc], gdome2/gdome-xml-eventl.[hc], gdome2/gdome-xml-mevent.[hc], gdome2/gdome-xml-nodel.[hc], new files. Basically, we have in each .h file: - Structure definition. - gdome_xml_* function declarations. - vtable declarations. in each .c file, we have: - header inclusion. - vtable declaration. - gdome_xml_* function implementation. * gdome2/gdome-xml.[hc] : removed. * configure.in : dump version unmber to 0.3 It now compiles again. (the breakage lasted 4 hours) 01/04/2000 Mathieu Lacage * gdome2/gdome-xml.c : make it compile. Now, need to find anders and ask him for his test prgm for Gdome. I wonder if things will work with this awfull implementation... * configure.in : dump version number to 0.2. 01/04/2000 Mathieu Lacage * gdome2/gdome-xml.c : - add implementation for NodeList. - cleanups. I will try compiling soon. There are issues on the xmlSetNodeValue function from libxml --> it seems not to handle the attribute code properly. 31/03/2000 Mathieu Lacage * gdome2/gdome-xml.c : - remove all the implementations which are child of Node except for Element and Attribute. - gdome_evntl_get_priv : rename : gdome_evntl_get_attribute. - change lots of checks to be still there when compiled with g_return_* as NoOp. - removed gdome_a_mkref. Now, you can use gdome_n_mkref for Attribute thanks to the common structures. * gdome2/gdome.[hc] : some indentation fixes. 30/03/2000 Mathieu Lacage * Changelog : new Changelog. old one is in Changelog.gdome1. * README : new README. old one is in README.gdome1. * gdome2 : new source directory. mv gdome gdome2. * configure.in : remove old stuff. add checks to specify the location of the libxml library. That way, we can use both libxml2 and libxml during developement. * Makefile.am, autogen.sh : change to match the directory name change (gdome -> gdome2). * gdome2/rxml* : remove. * gdome2/*rdom* : remove. * ifgen.pl, DOM* : remove. * gdome2/Makefile.am : cleanups. Remove code autogeneration. gdome2-0.8.1/INSTALL0000644000000000000000000001722707437370270007377 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. gdome2-0.8.1/Makefile.am0000664000076400007640000000222307606515342010433 NULL = SUBDIRS = \ libgdome \ test \ gtk-doc \ $(NULL) confexecdir=$(libdir) confexec_DATA = gdomeConf.sh pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA=gdome2.pc m4dir = $(datadir)/aclocal m4_DATA = gdome2.m4 bin_SCRIPTS = gdome-config man_MANS = gdome-config.1 EXTRA_DIST = \ COPYING.LIB \ MAINTAINERS \ AUTHORS \ NEWS \ gdomeConf.sh.in \ gdome-config.in \ gdome2.spec \ gdome2.m4 \ gdome-config.1 \ gdome2.pc.in \ README.developer \ $(NULL) ## We create gdomeConf.sh here and not from configure because we want ## to get the paths expanded correctly. Macros like srcdir are given ## the value NONE in configure if the user doesn't specify them (this ## is an autoconf feature, not a bug). gdomeConf.sh: gdomeConf.sh.in Makefile ## Use sed and then mv to avoid problems if the user interrupts. sed -e 's?\@GDOME_LIBDIR\@?$(GDOME_LIBDIR)?g' \ -e 's?\@GDOME_INCLUDEDIR\@?$(GDOME_INCLUDEDIR)?g' \ -e 's?\@PACKAGE\@?$(PACKAGE)?g' \ -e 's?\@VERSION\@?$(VERSION)?g' \ -e 's?\@GDOME_LIBS\@?$(GDOME_LIBS)?g' \ < $(srcdir)/gdomeConf.sh.in > gdomeConf.tmp \ && mv gdomeConf.tmp gdomeConf.sh gdome2-0.8.1/NEWS0000664000076400007640000000000007072636733007072 gdome2-0.8.1/acconfig.h0000664000076400007640000000010207276336206010316 /* 1 if debugging reference counting else 0 */ #undef DEBUG_REFCNTgdome2-0.8.1/aclocal.m40000664000076400007640000042251707740102202010235 dnl aclocal.m4 generated automatically by aclocal 1.4-p5 dnl Copyright (C) 1994, 1995-8, 1999, 2001 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. # 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([,]))]) # 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)]) # Add --enable-maintainer-mode option to configure. # From Jim Meyering # serial 1 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT($USE_MAINTAINER_MODE) AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_SUBST($1_TRUE) AC_SUBST($1_FALSE) if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi]) # isc-posix.m4 serial 1 (gettext-0.10.40) dnl Copyright (C) 1995-2002 Free Software Foundation, Inc. dnl This file is free software, distributed under the terms of the GNU dnl General Public License. As a special exception to the GNU General dnl Public License, this file may be distributed as part of a program dnl that contains a configuration script generated by Autoconf, under dnl the same distribution terms as the rest of that program. # This test replaces the one in autoconf. # Currently this macro should have the same name as the autoconf macro # because gettext's gettext.m4 (distributed in the automake package) # still uses it. Otherwise, the use in gettext.m4 makes autoheader # give these diagnostics: # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX undefine([AC_ISC_POSIX]) AC_DEFUN([AC_ISC_POSIX], [ dnl This test replaces the obsolescent AC_ISC_POSIX kludge. AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) ] ) # libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- # serial 46 AC_PROG_LIBTOOL AC_DEFUN([AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) ]) 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_CC])dnl AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl _LT_AC_PROG_ECHO_BACKSLASH # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then AC_PATH_MAGIC fi ;; esac AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(STRIP, strip, :) ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], enable_win32_dll=yes, enable_win32_dll=no) AC_ARG_ENABLE(libtool-lock, [ --disable-libtool-lock avoid locking (might break parallel builds)]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host 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.$ac_objext` 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_LANG_SAVE AC_LANG_C AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_RESTORE]) 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* | *-*-pw32*) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, [AC_TRY_LINK([], [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); DllMain (0, 0, 0);], [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) case $host/$CC in *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) # old mingw systems require "-dll" to link a DLL, while more recent ones # require "-mdll" SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -mdll" AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) CFLAGS="$SAVE_CFLAGS" ;; *-*-cygwin* | *-*-pw32*) # cygwin systems need to pass --dll to the linker, and not link # crt.o which will require a WinMain@16 definition. lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; esac ;; ]) esac _LT_AC_LTCONFIG_HACK ]) # AC_LIBTOOL_HEADER_ASSERT # ------------------------ AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT], [AC_CACHE_CHECK([whether $CC supports assert without backlinking], [lt_cv_func_assert_works], [case $host in *-*-solaris*) if test "$GCC" = yes && test "$with_gnu_ld" != yes; then case `$CC --version 2>/dev/null` in [[12]].*) lt_cv_func_assert_works=no ;; *) lt_cv_func_assert_works=yes ;; esac fi ;; esac]) if test "x$lt_cv_func_assert_works" = xyes; then AC_CHECK_HEADERS(assert.h) fi ])# AC_LIBTOOL_HEADER_ASSERT # _LT_AC_CHECK_DLFCN # -------------------- AC_DEFUN([_LT_AC_CHECK_DLFCN], [AC_CHECK_HEADERS(dlfcn.h) ])# _LT_AC_CHECK_DLFCN # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # --------------------------------- AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PROG_NM]) AC_REQUIRE([AC_OBJEXT]) # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl # 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 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) # Its linker distinguishes data from code symbols lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix*) symcode='[[BCDEGRST]]' ;; solaris* | sysv5*) symcode='[[BDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $host_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; 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. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext < $nlist) && 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.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[[]] = { EOF sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if AC_TRY_EVAL(ac_link) && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AC_FD_CC fi else echo "cannot find nm_test_var in $nlist" >&AC_FD_CC fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC fi else echo "$progname: failed program was:" >&AC_FD_CC cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then global_symbol_to_cdecl= global_symbol_to_c_name_address= else global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" fi if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi ]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE # _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # --------------------------------- AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], [# Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac PATH_SEPARATOR=$lt_cv_sys_path_separator fi ])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac echo=${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 && 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' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # 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=$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' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "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' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "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 configure 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' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "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 echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "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-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(ECHO) AC_DIVERT_POP ])# _LT_AC_PROG_ECHO_BACKSLASH # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ------------------------------------------------------------------ AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], [if test "$cross_compiling" = yes; then : [$4] else AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); }] EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_unknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF # AC_LIBTOOL_DLOPEN_SELF # ------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; 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 ])# AC_LIBTOOL_DLOPEN_SELF AC_DEFUN([_LT_AC_LTCONFIG_HACK], [AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl # 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' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" need_locks="$enable_libtool_lock" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o if test x"$host" != x"$build"; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= 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 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 $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Allow CC to be a program name with arguments. set dummy $CC compiler="[$]2" AC_MSG_CHECKING([for objdir]) 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 AC_MSG_RESULT($objdir) AC_ARG_WITH(pic, [ --with-pic try to use only PIC/non-PIC objects [default=use both]], pic_mode="$withval", pic_mode=default) test -z "$pic_mode" && pic_mode=default # We assume here that the value for lt_cv_prog_cc_pic will not be cached # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. AC_MSG_CHECKING([for $compiler option to produce PIC]) AC_CACHE_VAL(lt_cv_prog_cc_pic, [ lt_cv_prog_cc_pic= lt_cv_prog_cc_shlib= lt_cv_prog_cc_wl= lt_cv_prog_cc_static= lt_cv_prog_cc_no_builtin= lt_cv_prog_cc_can_build_shared=$can_build_shared if test "$GCC" = yes; then lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-static' case $host_os in 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 # not sure about C++ programs. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" ;; 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'. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_cv_prog_cc_pic='-fno-common' ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; sysv4*MP*) if test -d /usr/nec; then lt_cv_prog_cc_pic=-Kconform_pic fi ;; *) lt_cv_prog_cc_pic='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case $host_os in aix3* | aix4* | aix5*) lt_cv_prog_cc_wl='-Wl,' # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_cv_prog_cc_static='-Bstatic' else lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; hpux9* | hpux10* | hpux11*) # Is there a better lt_cv_prog_cc_static that works with the bundled CC? lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" lt_cv_prog_cc_pic='+Z' ;; irix5* | irix6*) lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; newsos6) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) lt_cv_prog_cc_pic='-Kpic' lt_cv_prog_cc_static='-dn' lt_cv_prog_cc_shlib='-belf' ;; solaris*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) lt_cv_prog_cc_pic='-PIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' if test "x$host_vendor" = xsni; then lt_cv_prog_cc_wl='-LD' else lt_cv_prog_cc_wl='-Wl,' fi ;; uts4*) lt_cv_prog_cc_pic='-pic' lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_cv_prog_cc_pic='-Kconform_pic' lt_cv_prog_cc_static='-Bstatic' fi ;; *) lt_cv_prog_cc_can_build_shared=no ;; esac fi ]) if test -z "$lt_cv_prog_cc_pic"; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([$lt_cv_prog_cc_pic]) # Check to make sure the pic_flag actually works. AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" AC_TRY_COMPILE([], [], [dnl 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 lt_cv_prog_cc_pic_works=no else lt_cv_prog_cc_pic_works=yes fi ;; *) lt_cv_prog_cc_pic_works=yes ;; esac ], [dnl lt_cv_prog_cc_pic_works=no ]) CFLAGS="$save_CFLAGS" ]) if test "X$lt_cv_prog_cc_pic_works" = Xno; then lt_cv_prog_cc_pic= lt_cv_prog_cc_can_build_shared=no else lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" fi AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) fi # Check for any special shared library compilation flags. if test -n "$lt_cv_prog_cc_shlib"; then AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then : else AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) lt_cv_prog_cc_can_build_shared=no fi fi AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl lt_cv_prog_cc_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) LDFLAGS="$save_LDFLAGS" ]) # Belt *and* braces to stop my trousers falling down: test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) pic_flag="$lt_cv_prog_cc_pic" special_shlib_compile_flags="$lt_cv_prog_cc_shlib" wl="$lt_cv_prog_cc_wl" link_static_flag="$lt_cv_prog_cc_static" no_builtin_flag="$lt_cv_prog_cc_no_builtin" can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) AC_CACHE_VAL([lt_cv_compiler_c_o], [ $rm -r conftest 2>/dev/null mkdir conftest cd conftest echo "int some_variable = 0;" > conftest.$ac_ext 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.$ac_objext" compiler_c_o=no if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; 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 lt_cv_compiler_c_o=no else lt_cv_compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&AC_FD_CC lt_cv_compiler_c_o=no fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null ]) compiler_c_o=$lt_cv_compiler_c_o AC_MSG_RESULT([$compiler_c_o]) if test x"$compiler_c_o" = x"yes"; then # Check to see if we can write to a .lo AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) AC_CACHE_VAL([lt_cv_compiler_o_lo], [ lt_cv_compiler_o_lo=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" save_objext="$ac_objext" ac_objext=lo AC_TRY_COMPILE([], [int some_variable = 0;], [dnl # 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 lt_cv_compiler_o_lo=no else lt_cv_compiler_o_lo=yes fi ]) ac_objext="$save_objext" CFLAGS="$save_CFLAGS" ]) compiler_o_lo=$lt_cv_compiler_o_lo AC_MSG_RESULT([$compiler_o_lo]) 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 AC_MSG_CHECKING([if we can lock with hard links]) 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 AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi if test "$GCC" = yes; then # Check to see if options -fno-rtti -fno-exceptions are supported by compiler AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no AC_TRY_COMPILE([], [int some_variable = 0;], [dnl # 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 compiler_rtti_exceptions=no else compiler_rtti_exceptions=yes fi ]) CFLAGS="$save_CFLAGS" AC_MSG_RESULT([$compiler_rtti_exceptions]) if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # See if the linker supports building shared libraries. AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) 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= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= link_all_deplibs=unknown 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. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # 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 "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; 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* | aix5*) # On AIX, the GNU linker is very broken # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. 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 $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_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 $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # 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_expsyms_cmds='test -f $output_objdir/impgen.c || \ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ test -f $output_objdir/impgen.exe || (cd $output_objdir && \ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ case $host_os in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ ;; esac # mingw and cygwin differ, and it's simplest to just exclude the union # of the two symbol sets. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one (in ltdll.c) if test "x$lt_cv_need_dllmain" = "xyes"; then ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' else ltdll_obj= ltdll_cmds= fi # 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. # Be careful not to strip the DATA tag left be newer dlltools. export_symbols_cmds="$ltdll_cmds"' $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \[$]# in 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done; fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 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 $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${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 $linker_flags' 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 $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${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* | pw32*) # 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 $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$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* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. hardcode_direct=yes archive_cmds='' hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) 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 esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then shared_flag='${wl}-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall can do strange things, so it is better to # generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. allow_undefined_flag='${wl}-berok' # This is a bit strange, but is similar to how AIX traditionally builds # it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_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* | pw32*) # 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 $compiler_flags `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$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[[012]]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on allow_undefined_flag='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes hardcode_shlibpath_var=no whole_archive_flag_spec='-all_load $convenience' ;; 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 $linker_flags /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 $linker_flags' 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 $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; 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 "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case "$host_os" in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_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 -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' #Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes export_dynamic_flag_spec='${wl}-Bexport' ;; solaris*) # gcc --version < 3.0 without binutils cannot create self contained # shared libraries reliably, requiring libgcc.a to resolve some of # the object symbols generated in some cases. Libraries that use # assert need libgcc.a to resolve __eprintf, for example. Linking # a copy of libgcc.a into every shared library to guarantee resolving # such symbols causes other problems: According to Tim Van Holder # , C++ libraries end up with a separate # (to the application) exception stack for one thing. no_undefined_flag=' -z defs' if test "$GCC" = yes; then case `$CC --version 2>/dev/null` in [[12]].*) cat <&2 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably *** create self contained shared libraries on Solaris systems, without *** introducing a dependency on libgcc.a. Therefore, libtool is disabling *** -no-undefined support, which will at least allow you to build shared *** libraries. However, you may find that when you link such libraries *** into an application without using GCC, you have to manually add *** \`gcc --print-libgcc-file-name\` to the link command. We urge you to *** upgrade to a newer version of GCC. Another option is to rebuild your *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. EOF no_undefined_flag= ;; esac fi # $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 $linker_flags' 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 $linker_flags~$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 link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsno; then archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 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 $linker_flags' 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 $linker_flags~$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 $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 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 $linker_flags' 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 $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5uw7* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac fi AC_MSG_RESULT([$ld_shlibs]) test "$ld_shlibs" = no && can_build_shared=no # Check hardcoding attributes. AC_MSG_CHECKING([how to hardcode library paths into programs]) 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 AC_MSG_RESULT([$hardcode_action]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics AC_MSG_CHECKING([dynamic linker 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" 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* | aix5*) version_type=linux if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) 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. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}.so$major' fi shlibpath_var=LIBPATH fi ;; 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 ;; 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 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* | pw32*) version_type=windows need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin*) library_names_spec='$libname.dll.a' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog .libs/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' ;; yes,mingw*) library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` ;; yes,pw32*) library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' ;; *) library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH ;; 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*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; 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 hardcode_into_libs=yes ;; 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= ;; *) 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}" ;; # 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 # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no 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 shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case "$host_os" in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes 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 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 hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; 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 sni) shlibpath_overrides_runpath=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; 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 AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no # Report the final consequences. AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) 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*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) 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 variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi AC_LIBTOOL_DLOPEN_SELF if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], [$rm conftest* echo 'static int dummy;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_cv_prog_cc_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$save_allow_undefined_flag else cat conftest.err 1>&5 fi]) AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) ;; esac fi need_lc=${lt_cv_archive_cmds_need_lc-yes} # The second clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then : else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi if test -f "$ltmain"; then trap "$rm \"${ofile}T\"; exit 1" 1 2 15 $rm -f "${ofile}T" echo creating $ofile # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS \ AR AR_FLAGS CC LD LN_S NM SHELL \ 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 extract_expsyms_cmds old_archive_from_expsyms_cmds \ old_striplib striplib 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 \ global_symbol_to_c_name_address \ 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 | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done cat <<__EOF__ > "${ofile}T" #! $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 ltmain.sh. # # Copyright (C) 1996-2000 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 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # 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 add -lc for building shared libraries. build_libtool_need_lc=$need_lc # 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=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # The default C compiler. CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # 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=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_pic_flag pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$lt_compiler_o_lo # Must we lock files when doing compilation ? need_locks=$lt_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_support=$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=$lt_link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_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=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address # 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 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_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 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_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=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "${ofile}T" # 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 case $host_os in cygwin* | mingw* | pw32* | os2*) cat <<'EOF' >> "${ofile}T" # 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-2000 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() */ # # /* O_BINARY isn't required (or even defined sometimes) under Unix */ # #ifndef O_BINARY # #define O_BINARY 0 # #endif # # 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 < 1) # 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> "${ofile}T" || (rm -f "${ofile}T"; exit 1) mv -f "${ofile}T" "$ofile" || \ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" fi ])# _LT_AC_LTCONFIG_HACK # 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], [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], [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], [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_DISABLE_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_LIBTOOL_PICMODE - implement the --with-pic flag # Usage: AC_LIBTOOL_PICMODE[(MODE)] # Where MODE is either `yes' or `no'. If omitted, it defaults to # `both'. AC_DEFUN([AC_LIBTOOL_PICMODE], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl pic_mode=ifelse($#,1,$1,default)]) # AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library AC_DEFUN([AC_PATH_TOOL_PREFIX], [AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="ifelse([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" 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 break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi ]) # AC_PATH_MAGIC - find a file program which can recognise a shared library AC_DEFUN([AC_PATH_MAGIC], [AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH) else MAGIC_CMD=: fi fi ]) # 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_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac 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 AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_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 lt_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 "$lt_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 lt_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$lt_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_PROG_LD_GNU - AC_DEFUN([AC_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_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 lt_cv_prog_gnu_ld=yes else lt_cv_prog_gnu_ld=no fi]) with_gnu_ld=$lt_cv_prog_gnu_ld ]) # AC_PROG_LD_RELOAD_FLAG - find reload flag for linker # -- PORTME Some linkers may need a different reload flag. AC_DEFUN([AC_PROG_LD_RELOAD_FLAG], [AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag, [lt_cv_ld_reload_flag='-r']) reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" ]) # AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics AC_DEFUN([AC_DEPLIBS_CHECK_METHOD], [AC_CACHE_CHECK([how to recognise dependant libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_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. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in rhapsody* | darwin1.[[012]]) lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` ;; *) # Darwin 1.3 on lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20*|hpux11*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[[1234]] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux-gnu*) case $host_cpu in alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so\.[[0-9]]+\.[[0-9]]+$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv5uw[[78]]* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_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]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; esac ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method ]) # AC_PROG_NM - find the path to a BSD-compatible name lister AC_DEFUN([AC_PROG_NM], [AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl AC_MSG_CHECKING([for BSD-compatible nm]) AC_CACHE_VAL(lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/${ac_tool_prefix}nm if test -f $tmp_nm || test -f $tmp_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 # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then lt_cv_path_NM="$tmp_nm -p" break else lt_cv_path_NM=${lt_cv_path_NM="$tmp_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 "$lt_cv_path_NM" && lt_cv_path_NM=nm fi]) NM="$lt_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 $host in *-*-beos* | *-*-cygwin* | *-*-pw32*) # 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 and INCLTDL to the include flags for # the libltdl header and adds --enable-ltdl-convenience to the # configure arguments. Note that LIBLTDL and INCLTDL are not # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not # provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed # with '${top_builddir}/' and INCLTDL will be prefixed with # '${top_srcdir}/' (note the single quotes!). If your package is not # flat and you're not using automake, define top_builddir and # top_srcdir appropriately 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='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) ]) # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for # the libltdl installable library and INCLTDL to the include flags for # the libltdl header and adds --enable-ltdl-install to the configure # arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is # AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed # libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed # with '${top_srcdir}/' (note the single quotes!). If your package is # not flat and you're not using automake, define top_builddir and # top_srcdir appropriately 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='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) else ac_configure_args="$ac_configure_args --enable-ltdl-install=no" LIBLTDL="-lltdl" INCLTDL= fi ]) # old names AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) # This is just to silence aclocal about the macro not being used ifelse([AC_DISABLE_FAST_INSTALL]) dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not) dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page dnl also defines GSTUFF_PKG_ERRORS on error AC_DEFUN(PKG_CHECK_MODULES, [ succeeded=no if test -z "$PKG_CONFIG"; then AC_PATH_PROG(PKG_CONFIG, pkg-config, no) fi if test "$PKG_CONFIG" = "no" ; then echo "*** The pkg-config script could not be found. Make sure it is" echo "*** in your path, or set the PKG_CONFIG environment variable" echo "*** to the full path to pkg-config." echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then AC_MSG_CHECKING(for $2) if $PKG_CONFIG --exists "$2" ; then AC_MSG_RESULT(yes) succeeded=yes AC_MSG_CHECKING($1_CFLAGS) $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` AC_MSG_RESULT($$1_CFLAGS) AC_MSG_CHECKING($1_LIBS) $1_LIBS=`$PKG_CONFIG --libs "$2"` AC_MSG_RESULT($$1_LIBS) else $1_CFLAGS="" $1_LIBS="" ## If we have a custom action on failure, don't print errors, but ## do set a variable so people can do so. $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` ifelse([$4], ,echo $$1_PKG_ERRORS,) fi AC_SUBST($1_CFLAGS) AC_SUBST($1_LIBS) else echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." echo "*** See http://www.freedesktop.org/software/pkgconfig" fi fi if test $succeeded = yes; then ifelse([$3], , :, [$3]) else ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) fi ]) # Configure paths for GLIB # Owen Taylor 97-11-3 dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or dnl gthread is specified in MODULES, pass to glib-config dnl AC_DEFUN(AM_PATH_GLIB, [dnl dnl Get the cflags and libraries from the glib-config script dnl AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)], glib_config_prefix="$withval", glib_config_prefix="") AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)], glib_config_exec_prefix="$withval", glib_config_exec_prefix="") AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program], , enable_glibtest=yes) if test x$glib_config_exec_prefix != x ; then glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" if test x${GLIB_CONFIG+set} != xset ; then GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config fi fi if test x$glib_config_prefix != x ; then glib_config_args="$glib_config_args --prefix=$glib_config_prefix" if test x${GLIB_CONFIG+set} != xset ; then GLIB_CONFIG=$glib_config_prefix/bin/glib-config fi fi for module in . $4 do case "$module" in gmodule) glib_config_args="$glib_config_args gmodule" ;; gthread) glib_config_args="$glib_config_args gthread" ;; esac done AC_PATH_PROG(GLIB_CONFIG, glib-config, no) min_glib_version=ifelse([$1], ,0.99.7,$1) AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) no_glib="" if test "$GLIB_CONFIG" = "no" ; then no_glib=yes else GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" dnl dnl Now check if the installed GLIB is sufficiently new. (Also sanity dnl checks the results of glib-config to some extent dnl rm -f conf.glibtest AC_TRY_RUN([ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.glibtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If glib-config was correct, then it is best\n"); printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the glib-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); printf("*** correct copy of glib-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then AC_MSG_RESULT(yes) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$GLIB_CONFIG" = "no" ; then echo "*** The glib-config script installed by GLIB could not be found" echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GLIB_CONFIG environment variable to the" echo "*** full path to glib-config." else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" AC_TRY_LINK([ #include #include ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" echo "*** came with the system with the command" echo "***" echo "*** rpm --erase --nodeps gtk gtk-devel" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB was incorrectly installed" echo "*** or that you have moved GLIB since it was installed. In the latter case, you" echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) rm -f conf.glibtest ]) # Configure paths for GLIB # Owen Taylor 1997-2001 dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or dnl gthread is specified in MODULES, pass to pkg-config dnl AC_DEFUN(AM_PATH_GLIB_2_0, [dnl dnl Get the cflags and libraries from pkg-config dnl AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run a test GLIB program], , enable_glibtest=yes) pkg_config_args=glib-2.0 for module in . $4 do case "$module" in gmodule) pkg_config_args="$pkg_config_args gmodule-2.0" ;; gobject) pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done AC_PATH_PROG(PKG_CONFIG, pkg-config, no) no_glib="" if test x$PKG_CONFIG != xno ; then if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then : else echo *** pkg-config too old; version 0.7 or better required. no_glib=yes PKG_CONFIG=no fi else no_glib=yes fi min_glib_version=ifelse([$1], ,2.0.0,$1) AC_MSG_CHECKING(for GLIB - version >= $min_glib_version) if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" enable_glibtest=no fi if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then : else no_glib=yes fi fi if test x"$no_glib" = x ; then GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" dnl dnl Now check if the installed GLIB is sufficiently new. (Also sanity dnl checks the results of pkg-config to some extent) dnl rm -f conf.glibtest AC_TRY_RUN([ #include #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.glibtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } ],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)) ifelse([$2], , :, [$2]) else AC_MSG_RESULT(no) if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" AC_TRY_LINK([ #include #include ], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ], [ echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ], [ echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed."]) CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" GLIB_GENMARSHAL="" GOBJECT_QUERY="" GLIB_MKENUMS="" ifelse([$3], , :, [$3]) fi AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_GENMARSHAL) AC_SUBST(GOBJECT_QUERY) AC_SUBST(GLIB_MKENUMS) rm -f conf.glibtest ]) gdome2-0.8.1/config.guess0000755000076400007640000011315007740102202010701 #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-09-04' # 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 . # 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 build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi dummy=dummy-$$ trap 'rm -f $dummy.c $dummy.o $dummy.rel $dummy; exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. set_cc_for_build='case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int dummy(){}" > $dummy.c ; for c in cc gcc c89 ; do ($c $dummy.c -c -o $dummy.o) >/dev/null 2>&1 ; if test $? = 0 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; rm -f $dummy.c $dummy.o $dummy.rel ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) 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 # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # Netbsd (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # Determine the machine/vendor (is the vendor relevant). case "${UNAME_MACHINE}" in amiga) machine=m68k-unknown ;; arm32) machine=arm-unknown ;; atari*) machine=m68k-atari ;; sun3*) machine=m68k-sun ;; mac68k) machine=m68k-apple ;; macppc) machine=powerpc-apple ;; hp3[0-9][05]) machine=m68k-hp ;; ibmrt|romp-ibm) machine=romp-ibm ;; *) machine=${UNAME_MACHINE}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE}" in i386|sparc|amiga|arm*|hp300|mvme68k|vax|atari|luna68k|mac68k|news68k|next68k|pc532|sun3*|x68k) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit 0 ;; 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 .data \$Lformat: .byte 37,100,45,37,120,10,0 # "%d-%x\n" .text .globl main .align 4 .ent main main: .frame \$30,16,\$26,0 ldgp \$29,0(\$27) .prologue 1 .long 0x47e03d80 # implver \$0 lda \$2,-1 .long 0x47e20c21 # amask \$2,\$1 lda \$16,\$Lformat mov \$0,\$17 not \$1,\$18 jsr \$26,printf ldgp \$29,0(\$26) mov 0,\$16 jsr \$26,exit .end main EOF eval $set_cc_for_build $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null if test "$?" = 0 ; then case `./$dummy` in 0-0) UNAME_MACHINE="alpha" ;; 1-0) UNAME_MACHINE="alphaev5" ;; 1-1) UNAME_MACHINE="alphaev56" ;; 1-101) UNAME_MACHINE="alphapca56" ;; 2-303) UNAME_MACHINE="alphaev6" ;; 2-307) UNAME_MACHINE="alphaev67" ;; 2-1307) UNAME_MACHINE="alphaev68" ;; 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-unknown-sysv4 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;; SR2?01:HI-UX/MPP:*:* | SR8000: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 ;; sparc*:NetBSD:*) echo `uname -p`-unknown-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*:OpenBSD:*:*) echo m68k-unknown-openbsd${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 ;; 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) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ 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 -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy echo mips-mips-riscos${UNAME_RELEASE} exit 0 ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax 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 ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit 0 ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build 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 -f $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:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${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=${UNAME_VERSION}.${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 BSD 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:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) case "${HPUX_REV}" in 11.[0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; esac ;; esac fi ;; esac if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #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` if test -z "$HP_ARCH"; then HP_ARCH=hppa; fi rm -f $dummy.c $dummy fi ;; esac echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit 0 ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit 0 ;; 3050*:HI-UX:*:*) eval $set_cc_for_build 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 -f $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:*:* | *3000*: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} | sed -e 's/\.[^.]*$/.X/' 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/ \ -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3D:*:*:*) echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit 0 ;; CRAY-2:*:*:*) echo cray2-cray-unicos exit 0 ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit 0 ;; hp300:OpenBSD:*:*) echo m68k-unknown-openbsd${UNAME_RELEASE} exit 0 ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/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:*:*) echo ${UNAME_MACHINE}-unknown-freebsd`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*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 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 ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit 0 ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux exit 0 ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; mips:Linux:*:*) case `sed -n '/^byte/s/^.*: \(.*\) endian/\1/p' < /proc/cpuinfo` in big) echo mips-unknown-linux-gnu && exit 0 ;; little) echo mipsel-unknown-linux-gnu && exit 0 ;; esac ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit 0 ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit 0 ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit 0 ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit 0 ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit 0 ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit 0 ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit 0 ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit 0 ;; i*86: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_supported_targets=`cd /; ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit 0 ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit 0 ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit 0 ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build cat >$dummy.c < #ifdef __cplusplus #include /* for printf() prototype */ 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-pc-linux-gnu\n", argv[1]); # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif # else printf ("%s-pc-linux-gnulibc1\n", argv[1]); # endif #else printf ("%s-pc-linux-gnuaout\n", argv[1]); #endif return 0; } EOF $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm -f $dummy.c $dummy && exit 0 rm -f $dummy.c $dummy test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 ;; i*86:DYNIX/ptx:4*:*) # 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. 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:[78]*) case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} 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 ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit 0 ;; pc:*:*:*) # Left here for compatibility: # 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]??A:*: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.*:* | m68*:LynxOS:3.0*:*) 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]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit 0 ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit 0 ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit 0 ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-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:*: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 ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos 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 ;; *:Darwin:*:*) echo `uname -p`-apple-darwin${UNAME_RELEASE} exit 0 ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) if test "${UNAME_MACHINE}" = "x86pc"; then UNAME_MACHINE=pc fi echo `uname -p`-${UNAME_MACHINE}-nto-qnx exit 0 ;; *:QNX:*:4*) echo i386-pc-qnx exit 0 ;; NSR-[KW]:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit 0 ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit 0 ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit 0 ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit 0 ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit 0 ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit 0 ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit 0 ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit 0 ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit 0 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit 0 ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit 0 ;; *:ITS:*:*) echo pdp10-unknown-its exit 0 ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit 0 ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos 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 eval $set_cc_for_build 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) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # 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 -f $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 cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: gdome2-0.8.1/config.h.in0000664000076400007640000000044407737562710010433 /* config.h.in. Generated automatically from configure.in by autoheader. */ /* Define if you have the ANSI C header files. */ #undef STDC_HEADERS /* 1 if debugging reference counting else 0 */ #undef DEBUG_REFCNT /* Define if you have the header file. */ #undef HAVE_DLFCN_H gdome2-0.8.1/config.sub0000755000076400007640000006710007740102202010347 #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. timestamp='2001-09-07' # 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. # Please send patches to . # # 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. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit 0 ;; --version | -v ) echo "$version" ; exit 0 ;; --help | --h* | -h ) echo "$usage"; exit 0 ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit 0;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; 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 nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*) 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 | -axis) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb 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. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ | c4x | clipper \ | d10v | d30v | dsp16xx \ | fr30 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | m32r | m68000 | m68k | m88k | mcore \ | mips16 | mips64 | mips64el | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el | mips64vr4300 \ | mips64vr4300el | mips64vr5000 | mips64vr5000el \ | mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \ | mipsisa32 \ | mn10200 | mn10300 \ | ns16k | ns32k \ | openrisc \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | s390 | s390x \ | sh | sh[34] | sh[34]eb | shbe | shle \ | sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \ | stormy16 | strongarm \ | tahoe | thumb | tic80 | tron \ | v850 \ | we32k \ | x86 | xscale \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; # 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*86 | x86_64) 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. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alphapca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armv*-* \ | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c54x-* \ | clipper-* | cray2-* | cydra-* \ | d10v-* | d30v-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | m32r-* \ | m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | mcore-* \ | mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \ | mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* | mipsbe-* | mipseb-* \ | mipsle-* | mipsel-* | mipstx39-* | mipstx39el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | s390-* | s390x-* \ | sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \ | sparc-* | sparc64-* | sparc86x-* | sparclite-* \ | sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \ | t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \ | v850-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \ | ymp-* \ | z8k-*) ;; # 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-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown 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 ;; [cjt]90) basic_machine=${basic_machine}-cray os=-unicos ;; crds | unos) basic_machine=m68k-crds ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; 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 ;; go32) basic_machine=i386-pc os=-go32 ;; 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*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*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 ;; 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 ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; 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 ;; mmix*) basic_machine=mmix-knuth os=-mmixware ;; monitor) basic_machine=m68k-rom68k os=-coff ;; msdos) basic_machine=i386-pc 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 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; 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 | nexgen) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon) basic_machine=i686-pc ;; pentiumii | pentium2) basic_machine=i686-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-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/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; 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 ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=t3e-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; 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 ;; windows32) basic_machine=i386-pc os=-windows32-msvcrt ;; 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 ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh3 | sh4 | sh3eb | sh4eb) basic_machine=sh-unknown ;; sparc | sparcv9 | sparcv9b) 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 ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) 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* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto*) os=-nto-qnx ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -macos* | -mpw* | -magic* | -mmixware* | -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 ;; -wince*) os=-wince ;; -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 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -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[0-9]* | -*MiNT | -MiNT[0-9]*) 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 ;; pdp10-*) os=-tops20 ;; 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 ;; f30[01]-fujitsu | f700-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[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: gdome2-0.8.1/configure0000775000076400007640000065240507740102204010307 #! /bin/sh # 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-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer" ac_help="$ac_help --with-libxml-prefix=[PFX] Specify location of libxml" ac_help="$ac_help --with-libxml-include-prefix=[PFX] Specify location of libxml headers" ac_help="$ac_help --with-libxml-libs-prefix=[PFX] Specify location of libxml libs" ac_help="$ac_help --with-html-dir=DIR Specify the path to install html docs" ac_help="$ac_help --with-ref-debug Add the reference counting debugging module [default=no]" 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]" # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac PATH_SEPARATOR=$lt_cv_sys_path_separator fi # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac echo=${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 && 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' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # 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=$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' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "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' && echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "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 configure 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' && echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "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 echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "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-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. echo=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. ECHO=$echo if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi ac_help="$ac_help --disable-libtool-lock avoid locking (might break parallel builds)" ac_help="$ac_help --with-pic try to use only PIC/non-PIC objects [default=use both]" ac_help="$ac_help --enable-glib-1=[no] Specify if you want to use glib 1" ac_help="$ac_help --with-glib-prefix=PFX Prefix where GLIB is installed (optional)" ac_help="$ac_help --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)" ac_help="$ac_help --disable-glibtest Do not try to compile and run a test GLIB program" ac_help="$ac_help --disable-glibtest do not try to compile and run a test GLIB program" # 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=libgdome/gdome.c # 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 VERSION=0.8.1 PACKAGE=gdome2 GDOME_VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'` 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:759: 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:812: 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:869: 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=$PACKAGE VERSION=$VERSION 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:908: 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:921: 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:934: 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:947: 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:960: 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 to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 echo "configure:974: checking whether to enable maintainer-specific portions of Makefiles" >&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE LIBXML_PREFIX="" # Check whether --with-libxml-prefix or --without-libxml-prefix was given. if test "${with_libxml_prefix+set}" = set; then withval="$with_libxml_prefix" LIBXML_PREFIX=$withval fi # Check whether --with-libxml-include-prefix or --without-libxml-include-prefix was given. if test "${with_libxml_include_prefix+set}" = set; then withval="$with_libxml_include_prefix" LIBXML_CFLAGS="-I$withval" fi # Check whether --with-libxml-libs-prefix or --without-libxml-libs-prefix was given. if test "${with_libxml_libs_prefix+set}" = set; then withval="$with_libxml_libs_prefix" LIBXML_LIBS="-L$withval -lxml2 -lz" fi # Check whether --with-html-dir or --without-html-dir was given. if test "${with_html_dir+set}" = set; then withval="$with_html_dir" : fi # Check whether --with-ref_debug or --without-ref_debug was given. if test "${with_ref_debug+set}" = set; then withval="$with_ref_debug" : fi echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 echo "configure:1039: checking for strerror in -lcposix" >&5 ac_lib_var=`echo cposix'_'strerror | 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="-lcposix $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 LIBS="$LIBS -lcposix" else echo "$ac_t""no" 1>&6 fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:1083: 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:1113: 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:1164: 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:1196: 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 1207 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:1212: \"$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:1238: 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:1243: 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:1271: 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 # 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:1314: 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 how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1367: 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:1388: \"$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:1405: \"$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:1422: \"$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 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:1447: 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:1460: \"$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:1527: \"$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 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," # Find the correct PATH separator. Usually this is `:', but # DJGPP uses `;' like DOS. if test "X${PATH_SEPARATOR+set}" != Xset; then UNAME=${UNAME-`uname 2>/dev/null`} case X$UNAME in *-DOS) lt_cv_sys_path_separator=';' ;; *) lt_cv_sys_path_separator=':' ;; esac PATH_SEPARATOR=$lt_cv_sys_path_separator fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 echo "configure:1581: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+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_cygwin=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_cygwin=no fi rm -f conftest* rm -f conftest* fi echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 echo "configure:1614: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+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_mingw32=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_mingw32=no fi rm -f conftest* rm -f conftest* fi echo "$ac_t""$ac_cv_mingw32" 1>&6 MINGW32= test "$ac_cv_mingw32" = yes && MINGW32=yes # 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:1718: 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:1739: 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 "$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:1768: checking for ld used by GCC" >&5 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac 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:1798: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 echo "configure:1801: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'lt_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=$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 lt_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 "$lt_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 lt_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$lt_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:1836: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'lt_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 lt_cv_prog_gnu_ld=yes else lt_cv_prog_gnu_ld=no fi fi echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6 with_gnu_ld=$lt_cv_prog_gnu_ld echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 echo "configure:1853: checking for $LD option to reload object files" >&5 if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else lt_cv_ld_reload_flag='-r' fi echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6 reload_flag=$lt_cv_ld_reload_flag test -n "$reload_flag" && reload_flag=" $reload_flag" echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 echo "configure:1865: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'lt_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. lt_cv_path_NM="$NM" else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/${ac_tool_prefix}nm if test -f $tmp_nm || test -f $tmp_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 # Tru64's nm complains that /dev/null is an invalid object file if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then lt_cv_path_NM="$tmp_nm -B" break elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then lt_cv_path_NM="$tmp_nm -p" break else lt_cv_path_NM=${lt_cv_path_NM="$tmp_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 "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi NM="$lt_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 echo "configure:1903: 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 echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 echo "configure:1924: checking how to recognise dependant libraries" >&5 if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_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. case $host_os in aix4* | aix5*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi4*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin* | mingw* | pw32*) lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' lt_cv_file_magic_cmd='/usr/bin/file -L' case "$host_os" in rhapsody* | darwin1.[012]) lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` ;; *) # Darwin 1.3 on lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' ;; esac ;; freebsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20*|hpux11*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; irix5* | irix6*) case $host_os in irix5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" ;; *) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1" ;; esac lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux-gnu*) case $host_cpu in alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | s390* ) lt_cv_deplibs_check_method=pass_all ;; *) # glibc up to 2.1.1 does not perform some relocations on ARM lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; esac lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' else lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; openbsd*) lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' else lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library' fi ;; osf3* | osf4* | osf5*) # this will be overridden with pass_all, but let us keep it just in case lt_cv_deplibs_check_method='file_magic COFF format alpha shared library' lt_cv_file_magic_test_file=/shlib/libc.so lt_cv_deplibs_check_method=pass_all ;; sco3.2v5*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_test_file=/lib/libc.so ;; sysv5uw[78]* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) case $host_vendor in motorola) lt_cv_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]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; esac ;; esac fi echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method echo $ac_n "checking for object suffix""... $ac_c" 1>&6 echo "configure:2107: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext if { (eval echo configure:2113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; esac done else { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } fi rm -f conftest* fi echo "$ac_t""$ac_cv_objext" 1>&6 OBJEXT=$ac_cv_objext ac_objext=$ac_cv_objext echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 echo "configure:2133: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$CYGWIN" = yes || test "$MINGW32" = yes; then ac_cv_exeext=.exe else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= if { (eval echo configure:2143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done else { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } fi rm -f conftest* test x"${ac_cv_exeext}" = x && ac_cv_exeext=no fi fi EXEEXT="" test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} echo "$ac_t""${ac_cv_exeext}" 1>&6 ac_exeext=$EXEEXT if test $host != $build; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= 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 echo "configure:2174: checking command to parse $NM output" >&5 if eval "test \"`echo '$''{'lt_cv_sys_global_symbol_pipe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else # 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 lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) # Its linker distinguishes data from code symbols lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" ;; irix*) symcode='[BCDEGRST]' ;; solaris* | sysv5*) symcode='[BDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # Handle CRLF in mingw tool chain opt_cr= case $host_os in mingw*) opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; 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. lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo configure:2257: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\") 1>&5; (eval $NM conftest.$ac_objext \| $lt_cv_sys_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.$ac_ext #ifdef __cplusplus extern "C" { #endif EOF # Now generate the symbol file. eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' cat <> conftest.$ac_ext #if defined (__STDC__) && __STDC__ # define lt_ptr void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = { EOF sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext cat <<\EOF >> conftest.$ac_ext {0, (lt_ptr) 0} }; #ifdef __cplusplus } #endif EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$no_builtin_flag" if { (eval echo configure:2308: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then pipe_works=yes fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" 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 $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" if test -z "$lt_cv_sys_global_symbol_pipe"; then global_symbol_to_cdecl= global_symbol_to_c_name_address= else global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" fi if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; then echo "$ac_t""failed" 1>&6 else echo "$ac_t""ok" 1>&6 fi 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 "configure:2357: 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:2367: \"$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 # Only perform the check for file, if the check method requires it case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 echo "configure:2402: checking for ${ac_tool_prefix}file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" 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 break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$ac_t""$MAGIC_CMD" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then echo $ac_n "checking for file""... $ac_c" 1>&6 echo "configure:2464: checking for file" >&5 if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case $MAGIC_CMD in /*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; ?:/*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. ;; *) ac_save_MAGIC_CMD="$MAGIC_CMD" IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="/usr/bin:$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" MAGIC_CMD="$lt_cv_path_MAGIC_CMD" 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 break fi done IFS="$ac_save_ifs" MAGIC_CMD="$ac_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then echo "$ac_t""$MAGIC_CMD" 1>&6 else echo "$ac_t""no" 1>&6 fi else MAGIC_CMD=: fi fi fi ;; esac # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2535: 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="${ac_tool_prefix}ranlib" break fi done IFS="$ac_save_ifs" 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 if test -z "$ac_cv_prog_RANLIB"; then if test -n "$ac_tool_prefix"; then # 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:2567: 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 else RANLIB=":" fi fi # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2602: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip" break fi done IFS="$ac_save_ifs" fi fi STRIP="$ac_cv_prog_STRIP" if test -n "$STRIP"; then echo "$ac_t""$STRIP" 1>&6 else echo "$ac_t""no" 1>&6 fi if test -z "$ac_cv_prog_STRIP"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:2634: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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_STRIP="strip" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" fi fi STRIP="$ac_cv_prog_STRIP" if test -n "$STRIP"; then echo "$ac_t""$STRIP" 1>&6 else echo "$ac_t""no" 1>&6 fi else STRIP=":" fi fi enable_dlopen=no enable_win32_dll=no # 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 && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in *-*-irix6*) # Find out which ABI we are using. echo '#line 2683 "configure"' > conftest.$ac_ext if { (eval echo configure:2684: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case `/usr/bin/file conftest.$ac_objext` 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:2705: 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 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 <&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* 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 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 # 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' # Constants: rm="rm -f" # Global variables: default_ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except M$VC, # which needs '.lib'). libext=a ltmain="$ac_aux_dir/ltmain.sh" ofile="$default_ofile" with_gnu_ld="$lt_cv_prog_gnu_ld" need_locks="$enable_libtool_lock" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru test -z "$AS" && AS=as test -z "$CC" && CC=cc test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$LD" && LD=ld test -z "$LN_S" && LN_S="ln -s" test -z "$MAGIC_CMD" && MAGIC_CMD=file test -z "$NM" && NM=nm test -z "$OBJDUMP" && OBJDUMP=objdump test -z "$RANLIB" && RANLIB=: test -z "$STRIP" && STRIP=: test -z "$ac_objext" && ac_objext=o if test x"$host" != x"$build"; then ac_tool_prefix=${host_alias}- else ac_tool_prefix= 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 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 $AR_FLAGS $oldlib$oldobjs$old_deplibs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" ;; *) old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # Allow CC to be a program name with arguments. set dummy $CC compiler="$2" echo $ac_n "checking for objdir""... $ac_c" 1>&6 echo "configure:2845: checking for objdir" >&5 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 # Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then withval="$with_pic" pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # We assume here that the value for lt_cv_prog_cc_pic will not be cached # in isolation, and that seeing it set (from the cache) indicates that # the associated values are set (in the cache) correctly too. echo $ac_n "checking for $compiler option to produce PIC""... $ac_c" 1>&6 echo "configure:2872: checking for $compiler option to produce PIC" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else lt_cv_prog_cc_pic= lt_cv_prog_cc_shlib= lt_cv_prog_cc_wl= lt_cv_prog_cc_static= lt_cv_prog_cc_no_builtin= lt_cv_prog_cc_can_build_shared=$can_build_shared if test "$GCC" = yes; then lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-static' case $host_os in 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 # not sure about C++ programs. lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" ;; 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'. lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' ;; beos* | irix5* | irix6* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_cv_prog_cc_pic='-fno-common' ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; sysv4*MP*) if test -d /usr/nec; then lt_cv_prog_cc_pic=-Kconform_pic fi ;; *) lt_cv_prog_cc_pic='-fPIC' ;; esac else # PORTME Check for PIC flags for the system compiler. case $host_os in aix3* | aix4* | aix5*) lt_cv_prog_cc_wl='-Wl,' # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_cv_prog_cc_static='-Bstatic' else lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; hpux9* | hpux10* | hpux11*) # Is there a better lt_cv_prog_cc_static that works with the bundled CC? lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" lt_cv_prog_cc_pic='+Z' ;; irix5* | irix6*) lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' # PIC (with -KPIC) is the default. ;; cygwin* | mingw* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_cv_prog_cc_pic='-DDLL_EXPORT' ;; newsos6) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' ;; osf3* | osf4* | osf5*) # All OSF/1 code is PIC. lt_cv_prog_cc_wl='-Wl,' lt_cv_prog_cc_static='-non_shared' ;; sco3.2v5*) lt_cv_prog_cc_pic='-Kpic' lt_cv_prog_cc_static='-dn' lt_cv_prog_cc_shlib='-belf' ;; solaris*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Wl,' ;; sunos4*) lt_cv_prog_cc_pic='-PIC' lt_cv_prog_cc_static='-Bstatic' lt_cv_prog_cc_wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) lt_cv_prog_cc_pic='-KPIC' lt_cv_prog_cc_static='-Bstatic' if test "x$host_vendor" = xsni; then lt_cv_prog_cc_wl='-LD' else lt_cv_prog_cc_wl='-Wl,' fi ;; uts4*) lt_cv_prog_cc_pic='-pic' lt_cv_prog_cc_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_cv_prog_cc_pic='-Kconform_pic' lt_cv_prog_cc_static='-Bstatic' fi ;; *) lt_cv_prog_cc_can_build_shared=no ;; esac fi fi if test -z "$lt_cv_prog_cc_pic"; then echo "$ac_t""none" 1>&6 else echo "$ac_t""$lt_cv_prog_cc_pic" 1>&6 # Check to make sure the pic_flag actually works. echo $ac_n "checking if $compiler PIC flag $lt_cv_prog_cc_pic works""... $ac_c" 1>&6 echo "configure:3024: checking if $compiler PIC flag $lt_cv_prog_cc_pic works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_pic_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* 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 lt_cv_prog_cc_pic_works=no else lt_cv_prog_cc_pic_works=yes fi ;; *) lt_cv_prog_cc_pic_works=yes ;; esac else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* lt_cv_prog_cc_pic_works=no fi rm -f conftest* CFLAGS="$save_CFLAGS" fi if test "X$lt_cv_prog_cc_pic_works" = Xno; then lt_cv_prog_cc_pic= lt_cv_prog_cc_can_build_shared=no else lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" fi echo "$ac_t""$lt_cv_prog_cc_pic_works" 1>&6 fi # Check for any special shared library compilation flags. if test -n "$lt_cv_prog_cc_shlib"; then echo "configure: warning: \`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries" 1>&2 if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$lt_cv_prog_cc_shlib[ ]" >/dev/null; then : else echo "configure: warning: add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" 1>&2 lt_cv_prog_cc_can_build_shared=no fi fi echo $ac_n "checking if $compiler static flag $lt_cv_prog_cc_static works""... $ac_c" 1>&6 echo "configure:3090: checking if $compiler static flag $lt_cv_prog_cc_static works" >&5 if eval "test \"`echo '$''{'lt_cv_prog_cc_static_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else lt_cv_prog_cc_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* lt_cv_prog_cc_static_works=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* LDFLAGS="$save_LDFLAGS" fi # Belt *and* braces to stop my trousers falling down: test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= echo "$ac_t""$lt_cv_prog_cc_static_works" 1>&6 pic_flag="$lt_cv_prog_cc_pic" special_shlib_compile_flags="$lt_cv_prog_cc_shlib" wl="$lt_cv_prog_cc_wl" link_static_flag="$lt_cv_prog_cc_static" no_builtin_flag="$lt_cv_prog_cc_no_builtin" can_build_shared="$lt_cv_prog_cc_can_build_shared" # Check to see if options -o and -c are simultaneously supported by compiler echo $ac_n "checking if $compiler supports -c -o file.$ac_objext""... $ac_c" 1>&6 echo "configure:3132: checking if $compiler supports -c -o file.$ac_objext" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_c_o'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else $rm -r conftest 2>/dev/null mkdir conftest cd conftest echo "int some_variable = 0;" > conftest.$ac_ext 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.$ac_objext" compiler_c_o=no if { (eval echo configure:3151: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; 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 lt_cv_compiler_c_o=no else lt_cv_compiler_c_o=yes fi else # Append any errors to the config.log. cat out/conftest.err 1>&5 lt_cv_compiler_c_o=no fi CFLAGS="$save_CFLAGS" chmod u+w . $rm conftest* out/* rmdir out cd .. rmdir conftest $rm -r conftest 2>/dev/null fi compiler_c_o=$lt_cv_compiler_c_o echo "$ac_t""$compiler_c_o" 1>&6 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 echo "configure:3180: checking if $compiler supports -c -o file.lo" >&5 if eval "test \"`echo '$''{'lt_cv_compiler_o_lo'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else lt_cv_compiler_o_lo=no save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -c -o conftest.lo" save_objext="$ac_objext" ac_objext=lo cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # 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 lt_cv_compiler_o_lo=no else lt_cv_compiler_o_lo=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* ac_objext="$save_objext" CFLAGS="$save_CFLAGS" fi compiler_o_lo=$lt_cv_compiler_o_lo echo "$ac_t""$compiler_o_lo" 1>&6 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 echo "configure:3229: checking if we can lock with hard links" >&5 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 if test "$hard_links" = no; then echo "configure: warning: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" 1>&2 need_locks=warn fi else need_locks=no fi if test "$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 echo "configure:3248: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 echo "int some_variable = 0;" > conftest.$ac_ext save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" compiler_rtti_exceptions=no cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # 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 compiler_rtti_exceptions=no else compiler_rtti_exceptions=yes fi else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -f conftest* CFLAGS="$save_CFLAGS" echo "$ac_t""$compiler_rtti_exceptions" 1>&6 if test "$compiler_rtti_exceptions" = "yes"; then no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' else no_builtin_flag=' -fno-builtin' fi fi # See if the linker supports building shared libraries. echo $ac_n "checking whether the linker ($LD) supports shared libraries""... $ac_c" 1>&6 echo "configure:3288: checking whether the linker ($LD) supports shared libraries" >&5 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= old_archive_from_expsyms_cmds= export_dynamic_flag_spec= whole_archive_flag_spec= thread_safe_flag_spec= hardcode_into_libs=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no hardcode_shlibpath_var=unsupported runpath_var= link_all_deplibs=unknown 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. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32*) # 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 "$GCC" != yes; then with_gnu_ld=no fi ;; openbsd*) with_gnu_ld=no ;; 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* | aix5*) # On AIX, the GNU linker is very broken # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. 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 $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_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 $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # 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_expsyms_cmds='test -f $output_objdir/impgen.c || \ sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ test -f $output_objdir/impgen.exe || (cd $output_objdir && \ if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ else $CC -o impgen impgen.c ; fi)~ $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' # cygwin and mingw dlls have different entry points and sets of symbols # to exclude. # FIXME: what about values for MSVC? dll_entry=__cygwin_dll_entry@12 dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12~ case $host_os in mingw*) # mingw values dll_entry=_DllMainCRTStartup@12 dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~ ;; esac # mingw and cygwin differ, and it's simplest to just exclude the union # of the two symbol sets. dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12 # recent cygwin and mingw systems supply a stub DllMain which the user # can override, but on older systems we have to supply one (in ltdll.c) if test "x$lt_cv_need_dllmain" = "xyes"; then ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' else ltdll_obj= ltdll_cmds= fi # 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. # Be careful not to strip the DATA tag left be newer dlltools. export_symbols_cmds="$ltdll_cmds"' $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is. # If DATA tags from a recent dlltool are present, honour them! archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname-def; else echo EXPORTS > $output_objdir/$soname-def; _lt_hint=1; cat $export_symbols | while read symbol; do set dummy \$symbol; case \$# in 2) echo " \$2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; *) echo " \$2 @ \$_lt_hint \$3 ; " >> $output_objdir/$soname-def;; esac; _lt_hint=`expr 1 + \$_lt_hint`; done; fi~ '"$ltdll_cmds"' $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' 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 $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${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 $linker_flags' 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 $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${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* | pw32*) # 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 $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$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* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. hardcode_direct=yes archive_cmds='' hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) 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 esac shared_flag='-shared' else # not using gcc if test "$host_cpu" = ia64; then shared_flag='${wl}-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi # It seems that -bexpall can do strange things, so it is better to # generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" else hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. allow_undefined_flag='${wl}-berok' # This is a bit strange, but is similar to how AIX traditionally builds # it's shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' fi fi ;; amigaos*) archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_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* | pw32*) # 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 $compiler_flags `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$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' ;; darwin* | rhapsody*) case "$host_os" in rhapsody* | darwin1.[012]) allow_undefined_flag='-undefined suppress' ;; *) # Darwin 1.3 on allow_undefined_flag='-flat_namespace -undefined suppress' ;; esac # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes hardcode_shlibpath_var=no whole_archive_flag_spec='-all_load $convenience' ;; 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 $linker_flags /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 $linker_flags' 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 $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9* | hpux10* | hpux11*) case $host_os in hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; 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 "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; openbsd*) hardcode_direct=yes hardcode_shlibpath_var=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_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 -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' #Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; sco3.2v5*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes export_dynamic_flag_spec='${wl}-Bexport' ;; solaris*) # gcc --version < 3.0 without binutils cannot create self contained # shared libraries reliably, requiring libgcc.a to resolve some of # the object symbols generated in some cases. Libraries that use # assert need libgcc.a to resolve __eprintf, for example. Linking # a copy of libgcc.a into every shared library to guarantee resolving # such symbols causes other problems: According to Tim Van Holder # , C++ libraries end up with a separate # (to the application) exception stack for one thing. no_undefined_flag=' -z defs' if test "$GCC" = yes; then case `$CC --version 2>/dev/null` in [12].*) cat <&2 *** Warning: Releases of GCC earlier than version 3.0 cannot reliably *** create self contained shared libraries on Solaris systems, without *** introducing a dependency on libgcc.a. Therefore, libtool is disabling *** -no-undefined support, which will at least allow you to build shared *** libraries. However, you may find that when you link such libraries *** into an application without using GCC, you have to manually add *** \`gcc --print-libgcc-file-name\` to the link command. We urge you to *** upgrade to a newer version of GCC. Another option is to rebuild your *** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. EOF no_undefined_flag= ;; esac fi # $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 $linker_flags' 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 $linker_flags~$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 link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) if test "x$host_vendor" = xsno; then archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? else archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie fi runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 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 $linker_flags' 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 $linker_flags~$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 $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' 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 $linker_flags' 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 $linker_flags' hardcode_direct=yes hardcode_minus_L=no hardcode_shlibpath_var=no hardcode_runpath_var=yes runpath_var=LD_RUN_PATH ;; sysv5uw7* | unixware7*) no_undefined_flag='${wl}-z ${wl}text' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' fi 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 # Check hardcoding attributes. echo $ac_n "checking how to hardcode library paths into programs""... $ac_c" 1>&6 echo "configure:3972: checking how to hardcode library paths into programs" >&5 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 striplib= old_striplib= echo $ac_n "checking whether stripping libraries is possible""... $ac_c" 1>&6 echo "configure:4000: checking whether stripping libraries is possible" >&5 if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" echo "$ac_t""yes" 1>&6 else echo "$ac_t""no" 1>&6 fi reload_cmds='$LD$reload_flag -o $output$reload_objs' test -z "$deplibs_check_method" && deplibs_check_method=unknown # PORTME Fill in your ld.so characteristics echo $ac_n "checking dynamic linker characteristics""... $ac_c" 1>&6 echo "configure:4014: checking dynamic linker characteristics" >&5 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" 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* | aix5*) version_type=linux if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) 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. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}.so$major' fi shlibpath_var=LIBPATH fi ;; 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 ;; 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 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* | pw32*) version_type=windows need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin*) library_names_spec='$libname.dll.a' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog .libs/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' ;; yes,mingw*) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` ;; yes,pw32*) library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/./-/g'`${versuffix}.dll' ;; *) library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH ;; 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*) library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; *) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; 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 hardcode_into_libs=yes ;; 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= ;; *) 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}" ;; # 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 # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no 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 shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; openbsd*) version_type=sunos need_lib_prefix=no need_version=no if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case "$host_os" in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes 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 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 hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; 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 sni) shlibpath_overrides_runpath=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; 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 $ac_n "checking if libtool supports shared libraries""... $ac_c" 1>&6 echo "configure:4411: checking if libtool supports shared libraries" >&5 echo "$ac_t""$can_build_shared" 1>&6 echo $ac_n "checking whether to build shared libraries""... $ac_c" 1>&6 echo "configure:4415: checking whether to build shared libraries" >&5 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*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac echo "$ac_t""$enable_shared" 1>&6 echo $ac_n "checking whether to build static libraries""... $ac_c" 1>&6 echo "configure:4438: checking whether to build static libraries" >&5 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes echo "$ac_t""$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 variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; cygwin* | mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; *) echo $ac_n "checking for shl_load""... $ac_c" 1>&6 echo "configure:4479: 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. */ 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 configure:4507: \"$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 "configure: 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 "configure:4525: 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 "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 lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen""... $ac_c" 1>&6 echo "configure:4563: 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. */ 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 configure:4591: \"$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 "configure: 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 dlopen in -ldl""... $ac_c" 1>&6 echo "configure:4609: 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 "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 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6 echo "configure:4647: checking for dlopen in -lsvld" >&5 ac_lib_var=`echo svld'_'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="-lsvld $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 lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else echo "$ac_t""no" 1>&6 echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 echo "configure:4685: 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 "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 lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" else echo "$ac_t""no" 1>&6 fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 echo "configure:4760: checking whether a program can dlopen itself" >&5 if eval "test \"`echo '$''{'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 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo configure:4831: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi echo "$ac_t""$lt_cv_dlopen_self" 1>&6 if test "x$lt_cv_dlopen_self" = xyes; then LDFLAGS="$LDFLAGS $link_static_flag" echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 echo "configure:4854: checking whether a statically linked program can dlopen itself" >&5 if eval "test \"`echo '$''{'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 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif #ifdef __cplusplus extern "C" void exit (int); #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } exit (status); } EOF if { (eval echo configure:4925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; 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 if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. echo $ac_n "checking whether -lc should be explicitly linked in""... $ac_c" 1>&6 echo "configure:4974: checking whether -lc should be explicitly linked in" >&5 if eval "test \"`echo '$''{'lt_cv_archive_cmds_need_lc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else $rm conftest* echo 'static int dummy;' > conftest.$ac_ext if { (eval echo configure:4981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_cv_prog_cc_wl compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo configure:4994: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\") 1>&5; (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$save_allow_undefined_flag else cat conftest.err 1>&5 fi fi echo "$ac_t""$lt_cv_archive_cmds_need_lc" 1>&6 ;; esac fi need_lc=${lt_cv_archive_cmds_need_lc-yes} # The second clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh # with your package, and you will get complaints that there are # no rules to generate ltmain.sh. if test -f "$ltmain"; then : else # If there is no Makefile yet, we rely on a make rule to execute # `config.status --recheck' to rerun these tests and create the # libtool script then. test -f Makefile && make "$ltmain" fi if test -f "$ltmain"; then trap "$rm \"${ofile}T\"; exit 1" 1 2 15 $rm -f "${ofile}T" echo creating $ofile # Now quote all the things that may contain metacharacters while being # careful not to overquote the AC_SUBSTed values. We take copies of the # variables and quote the copies for generation of the libtool script. for var in echo old_CC old_CFLAGS \ AR AR_FLAGS CC LD LN_S NM SHELL \ 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 extract_expsyms_cmds old_archive_from_expsyms_cmds \ old_striplib striplib 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 \ global_symbol_to_c_name_address \ 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 | \ extract_expsyms_cmds | old_archive_from_expsyms_cmds | \ postinstall_cmds | postuninstall_cmds | \ finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) # Double-quote double-evaled strings. eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; *) eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; esac done cat <<__EOF__ > "${ofile}T" #! $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 ltmain.sh. # # Copyright (C) 1996-2000 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 # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # 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 add -lc for building shared libraries. build_libtool_need_lc=$need_lc # 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=$lt_echo # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # The default C compiler. CC=$lt_CC # Is the compiler the GNU C compiler? with_gcc=$GCC # The linker used to build libraries. LD=$lt_LD # Whether we need hard or soft links. LN_S=$lt_LN_S # A BSD-compatible nm program. NM=$lt_NM # A symbol stripping program STRIP=$STRIP # Used to examine libraries when file_magic_cmd begins "file" MAGIC_CMD=$MAGIC_CMD # 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=$lt_reload_flag reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. wl=$lt_wl # Object file suffix (normally "o"). objext="$ac_objext" # Old archive suffix (normally "a"). libext="$libext" # Executable file suffix (normally ""). exeext="$exeext" # Additional compiler flags for building library objects. pic_flag=$lt_pic_flag pic_mode=$pic_mode # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_compiler_c_o # Can we write directly to a .lo ? compiler_o_lo=$lt_compiler_o_lo # Must we lock files when doing compilation ? need_locks=$lt_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_support=$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=$lt_link_static_flag # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_no_builtin_flag # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Compiler flag to generate thread-safe objects. thread_safe_flag_spec=$lt_thread_safe_flag_spec # Library versioning type. version_type=$version_type # Format of library name prefix. libname_spec=$lt_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=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB old_archive_cmds=$lt_old_archive_cmds old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build and install a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == file_magic. file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that forces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # Same as above, but a single script fragment to be evaled but not shown. finish_eval=$lt_finish_eval # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_global_symbol_pipe # Transform the output of nm in a proper C declaration global_symbol_to_cdecl=$lt_global_symbol_to_cdecl # Transform the output of nm in a C name address pair global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address # 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 # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist. hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single -rpath flag with a separated argument. hardcode_libdir_separator=$lt_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 # Variables whose values should be saved in libtool wrapper scripts and # restored at relink time. variables_saved_for_relink="$variables_saved_for_relink" # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Compile-time system search path for libraries sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries sys_lib_dlsearch_path_spec=$lt_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=$lt_export_symbols_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # ### END LIBTOOL CONFIG __EOF__ case $host_os in aix3*) cat <<\EOF >> "${ofile}T" # 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 case $host_os in cygwin* | mingw* | pw32* | os2*) cat <<'EOF' >> "${ofile}T" # 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-2000 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() */ # # /* O_BINARY isn't required (or even defined sometimes) under Unix */ # #ifndef O_BINARY # #define O_BINARY 0 # #endif # # 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 < 1) # 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> "${ofile}T" || (rm -f "${ofile}T"; exit 1) mv -f "${ofile}T" "$ofile" || \ (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T") chmod +x "$ofile" fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' # Prevent multiple expansion GLIB_1="no" # Check whether --enable-glib-1 or --disable-glib-1 was given. if test "${enable_glib_1+set}" = set; then enableval="$enable_glib_1" GLIB_1=yes fi if test "x$GLIB_1" = "xyes" then succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:5599: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$PKG_CONFIG" in /*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # 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_PKG_CONFIG="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG="$ac_cv_path_PKG_CONFIG" if test -n "$PKG_CONFIG"; then echo "$ac_t""$PKG_CONFIG" 1>&6 else echo "$ac_t""no" 1>&6 fi fi if test "$PKG_CONFIG" = "no" ; then echo "*** The pkg-config script could not be found. Make sure it is" echo "*** in your path, or set the PKG_CONFIG environment variable" echo "*** to the full path to pkg-config." echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then echo $ac_n "checking for glib""... $ac_c" 1>&6 echo "configure:5643: checking for glib" >&5 if $PKG_CONFIG --exists "glib" ; then echo "$ac_t""yes" 1>&6 succeeded=yes echo $ac_n "checking GLIB_CFLAGS""... $ac_c" 1>&6 echo "configure:5650: checking GLIB_CFLAGS" >&5 GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib"` echo "$ac_t""$GLIB_CFLAGS" 1>&6 echo $ac_n "checking GLIB_LIBS""... $ac_c" 1>&6 echo "configure:5655: checking GLIB_LIBS" >&5 GLIB_LIBS=`$PKG_CONFIG --libs "glib"` echo "$ac_t""$GLIB_LIBS" 1>&6 else GLIB_CFLAGS="" GLIB_LIBS="" ## If we have a custom action on failure, don't print errors, but ## do set a variable so people can do so. GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glib"` echo $GLIB_PKG_ERRORS fi else echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." echo "*** See http://www.freedesktop.org/software/pkgconfig" fi fi if test $succeeded = yes; then : else { echo "configure: error: Library requirements (glib) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; } fi GLIB_REQUIRED="glib" GLIB_MIN_VERSION=1.2.10 # Check whether --with-glib-prefix or --without-glib-prefix was given. if test "${with_glib_prefix+set}" = set; then withval="$with_glib_prefix" glib_config_prefix="$withval" else glib_config_prefix="" fi # Check whether --with-glib-exec-prefix or --without-glib-exec-prefix was given. if test "${with_glib_exec_prefix+set}" = set; then withval="$with_glib_exec_prefix" glib_config_exec_prefix="$withval" else glib_config_exec_prefix="" fi # Check whether --enable-glibtest or --disable-glibtest was given. if test "${enable_glibtest+set}" = set; then enableval="$enable_glibtest" : else enable_glibtest=yes fi if test x$glib_config_exec_prefix != x ; then glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix" if test x${GLIB_CONFIG+set} != xset ; then GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config fi fi if test x$glib_config_prefix != x ; then glib_config_args="$glib_config_args --prefix=$glib_config_prefix" if test x${GLIB_CONFIG+set} != xset ; then GLIB_CONFIG=$glib_config_prefix/bin/glib-config fi fi for module in . do case "$module" in gmodule) glib_config_args="$glib_config_args gmodule" ;; gthread) glib_config_args="$glib_config_args gthread" ;; esac done # Extract the first word of "glib-config", so it can be a program name with args. set dummy glib-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:5736: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GLIB_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$GLIB_CONFIG" in /*) ac_cv_path_GLIB_CONFIG="$GLIB_CONFIG" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_GLIB_CONFIG="$GLIB_CONFIG" # 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_GLIB_CONFIG="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_GLIB_CONFIG" && ac_cv_path_GLIB_CONFIG="no" ;; esac fi GLIB_CONFIG="$ac_cv_path_GLIB_CONFIG" if test -n "$GLIB_CONFIG"; then echo "$ac_t""$GLIB_CONFIG" 1>&6 else echo "$ac_t""no" 1>&6 fi min_glib_version=$GLIB_MIN_VERSION echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6 echo "configure:5771: checking for GLIB - version >= $min_glib_version" >&5 no_glib="" if test "$GLIB_CONFIG" = "no" ; then no_glib=yes else GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags` GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs` glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" rm -f conf.glibtest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.glibtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If glib-config was correct, then it is best\n"); printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n"); printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n"); printf("*** before re-running configure\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the glib-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n"); printf("*** correct copy of glib-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } EOF if { (eval echo configure:5870: \"$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* no_glib=yes fi rm -fr conftest* fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then echo "$ac_t""yes" 1>&6 : else echo "$ac_t""no" 1>&6 if test "$GLIB_CONFIG" = "no" ; then echo "*** The glib-config script installed by GLIB could not be found" echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the GLIB_CONFIG environment variable to the" echo "*** full path to glib-config." else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" cat > conftest.$ac_ext < #include int main() { return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ; return 0; } EOF if { (eval echo configure:5914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" echo "***" echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" echo "*** came with the system with the command" echo "***" echo "*** rpm --erase --nodeps gtk gtk-devel" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB was incorrectly installed" echo "*** or that you have moved GLIB since it was installed. In the latter case, you" echo "*** may want to edit the glib-config script: $GLIB_CONFIG" fi rm -f conftest* CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" { echo "configure: error: Could not find GLIB (see config.log for details)." 1>&2; exit 1; } fi rm -f conf.glibtest else succeeded=no if test -z "$PKG_CONFIG"; then # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:5960: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$PKG_CONFIG" in /*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # 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_PKG_CONFIG="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG="$ac_cv_path_PKG_CONFIG" if test -n "$PKG_CONFIG"; then echo "$ac_t""$PKG_CONFIG" 1>&6 else echo "$ac_t""no" 1>&6 fi fi if test "$PKG_CONFIG" = "no" ; then echo "*** The pkg-config script could not be found. Make sure it is" echo "*** in your path, or set the PKG_CONFIG environment variable" echo "*** to the full path to pkg-config." echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." else PKG_CONFIG_MIN_VERSION=0.9.0 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then echo $ac_n "checking for glib-2.0""... $ac_c" 1>&6 echo "configure:6004: checking for glib-2.0" >&5 if $PKG_CONFIG --exists "glib-2.0" ; then echo "$ac_t""yes" 1>&6 succeeded=yes echo $ac_n "checking GLIB_CFLAGS""... $ac_c" 1>&6 echo "configure:6011: checking GLIB_CFLAGS" >&5 GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0"` echo "$ac_t""$GLIB_CFLAGS" 1>&6 echo $ac_n "checking GLIB_LIBS""... $ac_c" 1>&6 echo "configure:6016: checking GLIB_LIBS" >&5 GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0"` echo "$ac_t""$GLIB_LIBS" 1>&6 else GLIB_CFLAGS="" GLIB_LIBS="" ## If we have a custom action on failure, don't print errors, but ## do set a variable so people can do so. GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glib-2.0"` echo $GLIB_PKG_ERRORS fi else echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." echo "*** See http://www.freedesktop.org/software/pkgconfig" fi fi if test $succeeded = yes; then : else { echo "configure: error: Library requirements (glib-2.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; exit 1; } fi GLIB_REQUIRED="glib-2.0" GLIB_MIN_VERSION=2.2.0 # Check whether --enable-glibtest or --disable-glibtest was given. if test "${enable_glibtest+set}" = set; then enableval="$enable_glibtest" : else enable_glibtest=yes fi pkg_config_args=glib-2.0 for module in . do case "$module" in gmodule) pkg_config_args="$pkg_config_args gmodule-2.0" ;; gobject) pkg_config_args="$pkg_config_args gobject-2.0" ;; gthread) pkg_config_args="$pkg_config_args gthread-2.0" ;; esac done # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:6072: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$PKG_CONFIG" in /*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # 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_PKG_CONFIG="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no" ;; esac fi PKG_CONFIG="$ac_cv_path_PKG_CONFIG" if test -n "$PKG_CONFIG"; then echo "$ac_t""$PKG_CONFIG" 1>&6 else echo "$ac_t""no" 1>&6 fi no_glib="" if test x$PKG_CONFIG != xno ; then if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then : else echo *** pkg-config too old; version 0.7 or better required. no_glib=yes PKG_CONFIG=no fi else no_glib=yes fi min_glib_version=$GLIB_MIN_VERSION echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6 echo "configure:6122: checking for GLIB - version >= $min_glib_version" >&5 if test x$PKG_CONFIG != xno ; then ## don't try to run the test against uninstalled libtool libs if $PKG_CONFIG --uninstalled $pkg_config_args; then echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH" enable_glibtest=no fi if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then : else no_glib=yes fi fi if test x"$no_glib" = x ; then GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0` GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0` GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0` GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args` GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args` glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \ sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` if test "x$enable_glibtest" = "xyes" ; then ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$GLIB_LIBS $LIBS" rm -f conf.glibtest if test "$cross_compiling" = yes; then echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < #include #include int main () { int major, minor, micro; char *tmp_version; system ("touch conf.glibtest"); /* HP/UX 9 (%@#!) writes to sscanf strings */ tmp_version = g_strdup("$min_glib_version"); if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { printf("%s, bad version string\n", "$min_glib_version"); exit(1); } if ((glib_major_version != $glib_config_major_version) || (glib_minor_version != $glib_config_minor_version) || (glib_micro_version != $glib_config_micro_version)) { printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n", $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version, glib_major_version, glib_minor_version, glib_micro_version); printf ("*** was found! If pkg-config was correct, then it is best\n"); printf ("*** to remove the old version of GLib. You may also be able to fix the error\n"); printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); printf("*** required on your system.\n"); printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n"); printf("*** to point to the correct configuration files\n"); } else if ((glib_major_version != GLIB_MAJOR_VERSION) || (glib_minor_version != GLIB_MINOR_VERSION) || (glib_micro_version != GLIB_MICRO_VERSION)) { printf("*** GLIB header files (version %d.%d.%d) do not match\n", GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION); printf("*** library (version %d.%d.%d)\n", glib_major_version, glib_minor_version, glib_micro_version); } else { if ((glib_major_version > major) || ((glib_major_version == major) && (glib_minor_version > minor)) || ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro))) { return 0; } else { printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n", glib_major_version, glib_minor_version, glib_micro_version); printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n", major, minor, micro); printf("*** GLIB is always available from ftp://ftp.gtk.org.\n"); printf("***\n"); printf("*** If you have already installed a sufficiently new version, this error\n"); printf("*** probably means that the wrong copy of the pkg-config shell script is\n"); printf("*** being found. The easiest way to fix this is to remove the old version\n"); printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n"); printf("*** correct copy of pkg-config. (In this case, you will have to\n"); printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); printf("*** so that the correct libraries are found at run-time))\n"); } } return 1; } EOF if { (eval echo configure:6236: \"$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* no_glib=yes fi rm -fr conftest* fi CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi if test "x$no_glib" = x ; then echo "$ac_t""yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" 1>&6 : else echo "$ac_t""no" 1>&6 if test "$PKG_CONFIG" = "no" ; then echo "*** A new enough version of pkg-config was not found." echo "*** See http://www.freedesktop.org/software/pkgconfig/" else if test -f conf.glibtest ; then : else echo "*** Could not run GLIB test program, checking why..." ac_save_CFLAGS="$CFLAGS" ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" cat > conftest.$ac_ext < #include int main() { return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ; return 0; } EOF if { (eval echo configure:6280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your" echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" echo "*** to the installed location Also, make sure you have run ldconfig if that" echo "*** is required on your system" echo "***" echo "*** If you have an old version installed, it is best to remove it, although" echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means GLIB is incorrectly installed." fi rm -f conftest* CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi fi GLIB_CFLAGS="" GLIB_LIBS="" GLIB_GENMARSHAL="" GOBJECT_QUERY="" GLIB_MKENUMS="" { echo "configure: error: Could not find GLIB (see config.log for details)." 1>&2; exit 1; } fi rm -f conf.glibtest fi XML_CONFIG="xml2-config" XML_MIN_VERSION=2.4.26 echo $ac_n "checking for GnomeXML libraries >= $XML_MIN_VERSION""... $ac_c" 1>&6 echo "configure:6325: checking for GnomeXML libraries >= $XML_MIN_VERSION" >&5 if test "x$LIBXML_PREFIX" != "x" then if ${LIBXML_PREFIX}/bin/$XML_CONFIG --version > /dev/null 2>&1 then XML_CONFIG=${LIBXML_PREFIX}/bin/$XML_CONFIG elif ! $XML_CONFIG --version > /dev/null 2>&1 then { echo "configure: error: Could not find libxml2 anywhere (see config.log for details)." 1>&2; exit 1; } fi fi vers=`$XML_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` minvers=`echo $XML_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` if test "$vers" -ge "$minvers" then LIBXML_LIBS="`$XML_CONFIG --libs`" LIBXML_CFLAGS="`$XML_CONFIG --cflags`" echo "$ac_t""found" 1>&6 else { echo "configure: error: You need at least libxml2 $XML_MIN_VERSION for this version of $PACKAGE" 1>&2; exit 1; } fi if test "x$with_html_dir" = "x" ; then HTML_DIR='$(prefix)/share/gtk-doc/html' else HTML_DIR=$with_html_dir fi if test "$with_ref_debug" = "yes" ; then echo Enabling reference counting debug support WITH_REF_DEBUG=1 cat >> confdefs.h <<\EOF #define DEBUG_REFCNT 1 EOF else WITH_REF_DEBUG=0 fi GDOME_LIBDIR='-L${libdir}' GDOME_INCLUDEDIR="-I${includedir} -I${includedir}/libgdome $GLIB_CFLAGS $LIBXML_CFLAGS" GDOME_LIBS="-lgdome $GLIB_LIBS $LIBXML_LIBS" 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 " Makefile libgdome/Makefile libgdome/gdomecore/Makefile libgdome/events/Makefile libgdome/xpath/Makefile test/Makefile test/apigen/Makefile gtk-doc/Makefile gdome-config gdome2.spec gdome-config.1 gdome2.pc 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%@GDOME_VERSION_INFO@%$GDOME_VERSION_INFO%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%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g s%@MAINT@%$MAINT%g s%@CC@%$CC%g s%@CPP@%$CPP%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%@LN_S@%$LN_S%g s%@OBJEXT@%$OBJEXT%g s%@EXEEXT@%$EXEEXT%g s%@ECHO@%$ECHO%g s%@RANLIB@%$RANLIB%g s%@STRIP@%$STRIP%g s%@LIBTOOL@%$LIBTOOL%g s%@PKG_CONFIG@%$PKG_CONFIG%g s%@GLIB_CFLAGS@%$GLIB_CFLAGS%g s%@GLIB_LIBS@%$GLIB_LIBS%g s%@GLIB_CONFIG@%$GLIB_CONFIG%g s%@GLIB_GENMARSHAL@%$GLIB_GENMARSHAL%g s%@GOBJECT_QUERY@%$GOBJECT_QUERY%g s%@GLIB_MKENUMS@%$GLIB_MKENUMS%g s%@GLIB_MIN_VERSION@%$GLIB_MIN_VERSION%g s%@GLIB_REQUIRED@%$GLIB_REQUIRED%g s%@XML_CONFIG@%$XML_CONFIG%g s%@LIBXML_LIBS@%$LIBXML_LIBS%g s%@LIBXML_CFLAGS@%$LIBXML_CFLAGS%g s%@XML_MIN_VERSION@%$XML_MIN_VERSION%g s%@GDOME_LIBDIR@%$GDOME_LIBDIR%g s%@GDOME_INCLUDEDIR@%$GDOME_INCLUDEDIR%g s%@GDOME_LIBS@%$GDOME_LIBS%g s%@HTML_DIR@%$HTML_DIR%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 test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h 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 gdome2-0.8.1/configure.in0000664000076400007640000000725607740026437010724 AC_INIT(libgdome/gdome.c) VERSION=0.8.1 PACKAGE=gdome2 GDOME_VERSION_INFO=`echo $VERSION | awk -F. '{ printf "%d:%d:%d", $1+$2, $3, $2 }'` AC_SUBST(GDOME_VERSION_INFO) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define) AM_MAINTAINER_MODE dnl dnl The following new parameters were added to offer dnl the ability to specify the location of the libxml dnl library during linking and compilation. dnl Mathieu Lacage 30/03/2000 dnl LIBXML_PREFIX="" AC_ARG_WITH(libxml-prefix, [ --with-libxml-prefix=[PFX] Specify location of libxml], LIBXML_PREFIX=$withval ) AC_ARG_WITH(libxml-include-prefix, [ --with-libxml-include-prefix=[PFX] Specify location of libxml headers], LIBXML_CFLAGS="-I$withval" ) AC_ARG_WITH(libxml-libs-prefix, [ --with-libxml-libs-prefix=[PFX] Specify location of libxml libs], LIBXML_LIBS="-L$withval -lxml2 -lz" ) AC_ARG_WITH(html-dir, [ --with-html-dir=DIR Specify the path to install html docs]) AC_ARG_WITH(ref_debug, [ --with-ref-debug Add the reference counting debugging module [default=no]]) dnl dnl Check the environment dnl AC_ISC_POSIX AC_PROG_CC AC_PROG_INSTALL AC_STDC_HEADERS AC_ARG_PROGRAM AM_PROG_LIBTOOL dnl AC_PROG_CXX dnl AM_PROG_LEX dnl AC_PROG_YACC AC_SUBST(CFLAGS) AC_SUBST(CPPFLAGS) AC_SUBST(LDFLAGS) dnl dnl find glib dnl GLIB_1="no" AC_ARG_ENABLE(glib-1, [ --enable-glib-1=[no] Specify if you want to use glib 1], GLIB_1=yes ) if test "x$GLIB_1" = "xyes" then PKG_CHECK_MODULES(GLIB, glib) GLIB_REQUIRED="glib" GLIB_MIN_VERSION=1.2.10 AM_PATH_GLIB($GLIB_MIN_VERSION,,AC_MSG_ERROR(Could not find GLIB (see config.log for details).)) else PKG_CHECK_MODULES(GLIB, glib-2.0) GLIB_REQUIRED="glib-2.0" GLIB_MIN_VERSION=2.2.0 AM_PATH_GLIB_2_0($GLIB_MIN_VERSION,,AC_MSG_ERROR(Could not find GLIB (see config.log for details).)) fi AC_SUBST(GLIB_MIN_VERSION) AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_REQUIRED) dnl dnl find libxml dnl XML_CONFIG="xml2-config" XML_MIN_VERSION=2.4.26 AC_MSG_CHECKING(for GnomeXML libraries >= $XML_MIN_VERSION) if test "x$LIBXML_PREFIX" != "x" then if ${LIBXML_PREFIX}/bin/$XML_CONFIG --version > /dev/null 2>&1 then XML_CONFIG=${LIBXML_PREFIX}/bin/$XML_CONFIG elif ! $XML_CONFIG --version > /dev/null 2>&1 then AC_MSG_ERROR(Could not find libxml2 anywhere (see config.log for details).) fi fi dnl dnl test version and init our variables dnl vers=`$XML_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` minvers=`echo $XML_MIN_VERSION | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'` if test "$vers" -ge "$minvers" then LIBXML_LIBS="`$XML_CONFIG --libs`" LIBXML_CFLAGS="`$XML_CONFIG --cflags`" AC_MSG_RESULT(found) else AC_MSG_ERROR(You need at least libxml2 $XML_MIN_VERSION for this version of $PACKAGE) fi if test "x$with_html_dir" = "x" ; then HTML_DIR='$(prefix)/share/gtk-doc/html' else HTML_DIR=$with_html_dir fi if test "$with_ref_debug" = "yes" ; then echo Enabling reference counting debug support WITH_REF_DEBUG=1 AC_DEFINE(DEBUG_REFCNT) else WITH_REF_DEBUG=0 fi AC_SUBST(XML_CONFIG) AC_SUBST(LIBXML_LIBS) AC_SUBST(LIBXML_CFLAGS) AC_SUBST(XML_MIN_VERSION) GDOME_LIBDIR='-L${libdir}' GDOME_INCLUDEDIR="-I${includedir} -I${includedir}/libgdome $GLIB_CFLAGS $LIBXML_CFLAGS" GDOME_LIBS="-lgdome $GLIB_LIBS $LIBXML_LIBS" AC_SUBST(GDOME_LIBDIR) AC_SUBST(GDOME_INCLUDEDIR) AC_SUBST(GDOME_LIBS) AC_SUBST(HTML_DIR) AC_OUTPUT([ Makefile libgdome/Makefile libgdome/gdomecore/Makefile libgdome/events/Makefile libgdome/xpath/Makefile test/Makefile test/apigen/Makefile gtk-doc/Makefile gdome-config gdome2.spec gdome-config.1 gdome2.pc ]) gdome2-0.8.1/gdome-config.1.in0000664000076400007640000000321707410566356011434 .TH GDOME2 1 "3 December 2001" Version @VERSION@ .SH NAME gdome-config - script to get information about the installed version of gdome2 .SH SYNOPSIS .B gdome-config [\-\-prefix\fI[=DIR]\fP] [\-\-exec-prefix\fI[=DIR]\fP] [\-\-libs] [\-\-cflags] [\-\-version] [\-\-help] .SH DESCRIPTION \fIgdome-config\fP is a tool that is used to determine the compile and linker flags that should be used to compile and link programs that use \fIgdome2\fP. .SH OPTIONS .l \fIgdome-config\fP accepts the following options: .TP 8 .B \-\-version Print the currently installed version of \fIgdome2\fP on the standard output. .TP 8 .B \-\-libs Print the linker flags that are necessary to link a \fIgdome2\fP program. .TP 8 .B \-\-cflags Print the compiler flags that are necessary to compile a \fIgdome2\fP program. .TP 8 .B \-\-prefix=DIR If specified, use DIR instead of the installation prefix that \fIgdome2\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option must be specified before any \-\-libs or \-\-cflags options. .TP 8 .B \-\-exec-prefix=DIR If specified, use DIR instead of the installation exec prefix that \fIgdome2\fP was built when computing the output for the \-\-cflags and \-\-libs options. This option must be specified before any \-\-libs or \-\-cflags options. .TP 8 .B \-\-help Print a short help text and exit. .SH AUTHOR This manual page was added by Enrico Zini for the Debian GNU/Linux system (but may be used by others). The page was made editing the manpage written by Fredrik Hallenberg for the libxml2 Debian GNU/Linux package. gdome2-0.8.1/gdome-config.in0000664000076400007640000000422007403634776011274 #! /bin/sh prefix="@prefix@" exec_prefix="@exec_prefix@" exec_prefix_set=no usage() { cat <&2 fi cflags=false libs=false while [ $# -gt 0 ] do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) optarg= ;; esac case "$1" in --prefix=*) prefix=$optarg if [ $exec_prefix_set = no ] then exec_prefix=$optarg fi ;; --prefix) echo $prefix ;; --exec-prefix=*) exec_prefix=$optarg exec_prefix_set=yes ;; --exec-prefix) echo $exec_prefix ;; --version) echo @VERSION@ exit 0 ;; --help) usage 0 ;; --cflags) cflags=true ;; --libs) libs=true ;; *) usage 1 ;; esac shift done the_libs="$the_libs -L${exec_prefix}/lib -lgdome `@GLIB_CONFIG@ --libs` `@XML_CONFIG@ --libs`" the_flags="$the_flags -I${prefix}/include -I${prefix}/include/libgdome `@GLIB_CONFIG@ --cflags` `@XML_CONFIG@ --cflags`" if $cflags; then all_flags="$the_flags" fi if $libs; then all_flags="$all_flags $services $the_libs" fi if test -z "$all_flags" || test "x$all_flags" = "x "; then exit 1 fi # Straight out any possible duplicates, but be careful to # get `-lfoo -lbar -lbaz' for `-lfoo -lbaz -lbar -lbaz' other_flags= rev_libs= for i in $all_flags; do case "$i" in # a library, save it for later, in reverse order -l*) rev_libs="$i $rev_libs" ;; *) case " $other_flags " in *\ $i\ *) ;; # already there *) other_flags="$other_flags $i" ;; # add it to output esac ;; esac done ord_libs= for i in $rev_libs; do case " $ord_libs " in *\ $i\ *) ;; # already there *) ord_libs="$i $ord_libs" ;; # add it to output in reverse order esac done echo $other_flags $ord_libs exit 0 gdome2-0.8.1/gdome2.pc.in0000664000076400007640000000047007737315571010516 prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: gdome2 Description: DOM level2 library for accessing XML files Version: @VERSION@ Requires: @GLIB_REQUIRED@ >= @GLIB_MIN_VERSION@, libxml-2.0 >= @XML_MIN_VERSION@ Libs: -L${libdir} -lgdome Cflags: -I${includedir}/libgdome gdome2-0.8.1/gdome2.spec.in0000664000076400007640000000771407740101634011041 %define nam gdome2 %define ver @VERSION@ %define rel 1 Summary: DOM level2 library for accessing XML files Name: %nam Version: %ver Release: %rel License: LGPL Group: Development/Libraries URL: http://gdome2.cs.unibo.it/ Source: http://gdome2.cs.unibo.it/tarball/%{nam}-%{ver}.tar.gz BuildRoot: /var/tmp/%{nam}-%{ver}-root BuildRequires: libxml2-devel >= @XML_MIN_VERSION@ BuildRequires: glib2 >= @GLIB_MIN_VERSION@ Requires: glib2 >= @GLIB_MIN_VERSION@ Requires: libxml2 >= @XML_MIN_VERSION@ %description gdome2 is a fast, light and complete DOM level2 implementation based on libxml2. Although it has been written for the GNOME project, it can be used stand-alone. A DOM implementation (also called a host implementation) is what makes a parsed XML or HTML document available for processing via the DOM interface. gdome2 currently supports the "Core", "XML", "Events" and "MutationEvents" modules from the DOM2 Recommendation (see http://www.w3.org/TR/DOM-Level-2-Core/ and http://www.w3.org/TR/DOM-L evel-2-Events/), and is supposed to become a full implementation of all the DOM Level2 standard. Now gdome2 also partially supports the XPath module from the DOM level 3 drafts. %package devel Summary: Development files for gdome2 Group: Development/Libraries Requires: gdome2 = %{ver} Requires: glib2-devel >= @GLIB_MIN_VERSION@ Requires: libxml2-devel >= @XML_MIN_VERSION@ %description devel This package contains the header files and static libraries for developing with gdome2. gdome2 is a fast, light and complete DOM level2 implementation based on libxml2. Although it has been written for the GNOME project, it can be used stand-alone. A DOM implementation (also called a host implementation) is what makes a parsed XML or HTML document available for processing via the DOM interface. gdome2 currently supports the "Core", "XML", "Events" and "MutationEvents" modules from the DOM2 Recommendation (see http://www.w3.org/TR/DOM-Level-2-Core/ and http://www.w3.org/TR/DOM-L evel-2-Events/), and is supposed to become a full implementation of all the DOM Level2 standard. Now gdome2 also partially supports the XPath module from the DOM level 3 drafts. %changelog * Sun Oct 05 2003 Paolo Casarini - fixed dependencies * Sun Dec 29 2002 Paolo Casarini patch provided by Oron Peled - %defattr(-,root,root) wasn't set for documents in the devel package. This cause wrong ownership of docs in non-root builds. - Update URL: and Source: locations - s/Copyright:/License:/ * Sun Mar 31 2002 Paolo Casarini - updated descriptions and summaries * Sat Dec 15 2001 Paolo Casarini - updated descriptions and summaries * Tue Oct 23 2001 Paolo Casarini - added the gdome-config.1 man page * Mon Aug 6 2001 Paolo Casarini - Merge of the Andrew release with mine * Thu Aug 2 2001 Andrew Chatham - Spec file created * Tue Jul 3 2001 Paolo Casarini - Initial release %prep %setup -q %build if [ ! -f configure ]; then ./autogen.sh --prefix=%{_prefix} --localstatedir=/var/lib fi %configure --localstatedir=/var/lib if [ "$SMP" != "" ]; then (make "MAKE=make -k -j $SMP"; exit 0) make else make fi make %install rm -rf $RPM_BUILD_ROOT %makeinstall %clean rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-, root, root) %doc AUTHORS MAINTAINERS ChangeLog INSTALL NEWS README COPYING COPYING.LIB %{_libdir}/lib*.so.* %files devel %defattr(-, root, root) %doc gtk-doc/html/*.html %doc %{_prefix}/share/man/man1/gdome-config.1* %{_bindir}/gdome-config %{_includedir}/* %{_libdir}/lib*.so %{_libdir}/*a %{_libdir}/*.sh %{_prefix}/share/aclocal/gdome2.m4 %{_libdir}/pkgconfig/gdome2.pc gdome2-0.8.1/install-sh0000755000000000000000000001273607437370271010353 #!/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 gdome2-0.8.1/ltmain.sh0000644000076400007640000041755607740102202010222 # ltmain.sh - Provide generalized library-building support services. # NOTE: Changing this file will not affect anything until you rerun configure. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 # 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 # 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) execute_dlfiles="$execute_dlfiles $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 this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= 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= prev= lastarg= srcfile="$nonopt" suppress_output= user_target=no for arg do case $prev in "") ;; xcompiler) # Aesthetically quote the previous argument. prev= lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` case $arg in # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac # Add the previous argument to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi continue ;; esac # 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 ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; -Xcompiler) prev=xcompiler continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" # Double-quote args containing other shell metacharacters. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") arg="\"$arg\"" ;; esac lastarg="$lastarg $arg" done IFS="$save_ifs" lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` # Add the arguments to base_compile. if test -z "$base_compile"; then base_compile="$lastarg" else base_compile="$base_compile $lastarg" fi 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 # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # 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 $run 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 if test "$pic_mode" != no; then # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" else # Don't build PIC code command="$base_compile $srcfile" fi 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 "$pic_mode" != default) && 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 # Unlock the critical section if it was locked if test "$need_locks" != no; then $run $rm "$lockfile" fi 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 if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $srcfile" else # All platforms use -DPIC, to notify preprocessed assembler code. command="$base_compile $srcfile $pic_flag -DPIC" fi 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 $run $rm "$lockfile" fi exit 0 ;; # libtool link mode link | relink) modename="$modename: link" case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-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 ;; *) allow_undefined=yes ;; esac libtool_args="$nonopt" compile_command="$nonopt" finalize_command="$nonopt" compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= # We need to know -static, to get the right output filenames. for arg do case $arg in -all-static | -static) if test "X$arg" = "X-all-static"; then if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&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 case $arg in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test ;; *) qarg=$arg ;; esac libtool_args="$libtool_args $qarg" # 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= continue ;; 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 ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= compile_command="$compile_command $qarg" finalize_command="$finalize_command $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= compile_command="$compile_command $wl$qarg" finalize_command="$finalize_command $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n $prev 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: more than one -exported-symbols argument is not allowed" exit 1 fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix*) compile_command="$compile_command $arg" finalize_command="$finalize_command $arg" ;; esac 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: cannot determine absolute directory name of \`$dir'" 1>&2 exit 1 fi dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$dir:"*) ;; *) dllsearchpath="$dllsearchpath:$dir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-mingw* | *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # The PATH hackery in wrapper scripts is required on Windows # in order for the loader to find any dlls it needs. $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; *) no_install=yes ;; esac 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) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -Wc,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Wl,*) args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" case $flag in *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") flag="\"$flag\"" ;; esac arg="$arg $wl$flag" compiler_flags="$compiler_flags $wl$flag" linker_flags="$linker_flags $flag" done IFS="$save_ifs" arg=`$echo "X$arg" | $Xsed -e "s/^ //"` ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker 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 ;; *.lo | *.$objext) # A library or standard object. if test "$prev" = dlfiles; then # This file was specified with -dlopen. if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $arg" 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= else case $arg in *.lo) libobjs="$libobjs $arg" ;; *) objs="$objs $arg" ;; esac fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi 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 # arg # 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 # argument parsing loop 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 # calculate the name of the file, without its directory outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" 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 object directory. 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 # Determine the type of output case $output in "") $echo "$modename: you must specify an output file" 1>&2 $echo "$help" 1>&2 exit 1 ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac libs="$libs $deplib" done deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 exit 1 ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do if test "$linkmode" = prog; then # Determine which files to process case $pass in dlopen) libs="$dlfiles" save_deplibs="$deplibs" # Collect dlpreopened libraries deplibs= ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi for deplib in $libs; do lib= found=no case $deplib in -l*) if test "$linkmode" = oldlib && test "$linkmode" = obj; then $echo "$modename: warning: \`-l' is ignored for archives/objects: $deplib" 1>&2 continue fi if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do # Search the libtool library lib="$searchdir/lib${name}.la" if test -f "$lib"; then found=yes break fi done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi ;; *) $echo "$modename: warning: \`-L' is ignored for archives/objects: $deplib" 1>&2 ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) if test "$deplibs_check_method" != pass_all; then echo echo "*** Warning: This library needs some functionality provided by $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." else echo echo "*** Warning: Linking the shared library $output against the" echo "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else $echo "$modename: cannot find the library \`$lib'" 1>&2 exit 1 fi # Check to see that this really is a libtool archive. if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : else $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` test "X$ladir" = "X$lib" && ladir="." dlname= dlopen= dlpreopen= libdir= library_names= old_library= # If the library was installed with an old release of libtool, # it will not redefine variable installed. installed=yes # Read the .la file case $lib in */* | *\\*) . $lib ;; *) . ./$lib ;; esac if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" = oldlib && test "$linkmode" = obj; }; then # Add dl[pre]opened files of deplib test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 exit 1 fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done elif test "$linkmode" != prog && test "$linkmode" != lib; then $echo "$modename: \`$lib' is not a convenience library" 1>&2 exit 1 fi continue fi # $pass = conv # 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 \`$lib'" 1>&2 exit 1 fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 exit 1 fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. dlprefiles="$dlprefiles $lib" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 abs_ladir="$ladir" fi ;; esac laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then $echo "$modename: warning: library \`$lib' was moved." 1>&2 dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi # $installed = yes name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir"; then $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 exit 1 fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... link_static=no # Whether the deplib will be linked statically if test -n "$library_names" && { test "$prefer_static_libs" = no || test -z "$old_library"; }; then # Link against this shared library if test "$linkmode,$pass" = "prog,link" || { test "$linkmode" = lib && test "$hardcode_into_libs" = yes; }; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. 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 if test "$linkmode" = prog; then # We need to hardcode the library path if test -n "$shlibpath_var"; then # Make sure the rpath contains only unique directories. case "$temp_rpath " in *" $dir "*) ;; *" $absdir "*) ;; *) temp_rpath="$temp_rpath $dir" ;; esac fi fi fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names realname="$2" shift; shift libname=`eval \\$echo \"$libname_spec\"` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin*) major=`expr $current - $age` versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" soname=`echo $soroot | sed -e 's/^.*\///'` newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a" # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else $show "extracting exported symbol list from \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$extract_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else $show "generating import library for \`$soname'" save_ifs="$IFS"; IFS='~' eval cmds=\"$old_archive_from_expsyms_cmds\" for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-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 if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && \ test "$hardcode_minus_L" != yes && \ test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi # Try to link the static library # 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_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo echo "*** Warning: This library needs some functionality provided by $lib." 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." if test "$module" = yes; then echo "*** Therefore, libtool will create a static module, that should work " echo "*** as long as the dlopening 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 build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else convenience="$convenience $dir/$old_library" old_convenience="$old_convenience $dir/$old_library" deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` test "X$dir" = "X$deplib" && dir="." # 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 absdir="$dir" fi ;; esac if grep "^installed=no" $deplib > /dev/null; then path="-L$absdir/$objdir" else eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi if test "$absdir" != "$libdir"; then $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 fi path="-L$absdir" fi ;; *) continue ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$deplibs $path" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then test "$pass" != scan && dependency_libs="$newdependency_libs" if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do case $deplib in -L*) new_libs="$deplib $new_libs" ;; *) case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi if test "$pass" = "conv" && { test "$linkmode" = "lib" || test "$linkmode" = "prog"; }; then libs="$deplibs" # reset libs deplibs= fi done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) 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" objs="$objs$old_deplibs" ;; lib) # 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 if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 exit 1 else echo echo "*** Warning: Linking the shared library $output against the non-libtool" echo "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi if test "$dlself" != no; then $echo "$modename: warning: \`-dlopen self' 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 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. 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-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-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-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) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header major=.`expr $current - $age` versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... minor_current=`expr $current + 1` verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current"; ;; irix) major=`expr $current - $age + 1` verstring="sgi$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do iface=`expr $revision - $loop` loop=`expr $loop - 1` verstring="sgi$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; 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" -ne 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" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. major=`expr $current - $age` versuffix="-$major" ;; *) $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" case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring="" ;; *) verstring="0.0" ;; esac 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 fi if test "$mode" != relink; then # Remove our outputs. $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}.* 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 # Eliminate all temporary directories. for path in $notinst_path; do lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'` deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'` dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'` done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd*) # Do not include libc due to us having libc/libc_r. ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # 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. ;; match_pattern*) set dummy $deplibs_check_method match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` for a_deplib in $deplibs; do name="`expr $a_deplib : '-l\(.*\)'`" # If $name is empty we are operating on a -L argument. if test -n "$name" && test "$name" != "0"; then libname=`eval \\$echo \"$libname_spec\"` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do if eval echo \"$potent_lib\" 2>/dev/null \ | sed 10q \ | egrep "$match_pattern_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 case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac 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." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." 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 fi 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 if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $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\" dep_rpath="$dep_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 dep_rpath=\"$hardcode_libdir_flag_spec\" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # 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 test -z "$dlname" && dlname=$soname 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\" 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\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? 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 save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" || exit $? done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? exit 0 fi # 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 ;; obj) 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$old_deplibs"; 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$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" eval cmds=\"$reload_cmds\" 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" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" eval cmds=\"$reload_cmds\" 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 ;; prog) case $host in *cygwin*) output=`echo $output | sed -e 's,.exe$,,;s,$,.exe,'` ;; esac 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_support" = 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 case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` ;; esac compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" 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 "$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 case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) case :$dllsearchpath: in *":$libdir:"*) ;; *) dllsearchpath="$dllsearchpath:$libdir";; esac ;; esac 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" 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$old_deplibs" | $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 void * #else # define lt_ptr char * # define const #endif /* The mapping between symbol names and symbols. */ const struct { const char *name; lt_ptr address; } lt_preloaded_symbols[] = {\ " eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" $echo >> "$output_objdir/$dlsyms" "\ {0, (lt_ptr) 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 "$need_relink" = no || 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 "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $run $rm $output # Link the executable and exit $show "$link_command" $run eval "$link_command" || exit $? exit 0 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 # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" 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 # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe ;; *) exeext= ;; 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: notinst_deplibs='$notinst_deplibs' 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'$exeext 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 relink_command_output=\`eval \$relink_command 2>&1\`; then : else $echo \"\$relink_command_output\" >&2 $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 # win32 systems need to use the prog path for dll # lookup to work *-*-cygwin* | *-*-pw32*) $echo >> $output "\ exec \$progdir/\$program \${1+\"\$@\"} " ;; # Backslashes separate directories on plain windows *-*-mingw | *-*-os2*) $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$old_deplibs "`$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 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" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` relink_command="$var=\"$var_value\"; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args)" relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` # 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 # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` if test -z "$libdir"; then $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 exit 1 fi newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlfiles="$newdlfiles $libdir/$name" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib` if test -z "$libdir"; then $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 exit 1 fi newdlprefiles="$newdlprefiles $libdir/$name" done dlprefiles="$newdlprefiles" fi $rm $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $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='$tdlname' # 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 # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $echo >> $output "\ relink_command=\"$relink_command\"" fi 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 || # Allow the use of GNU shtool's install command. $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; 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 *.$libext) # 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= relink_command= # 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" if test -n "$relink_command"; then $echo "$modename: warning: relinking \`$file'" 1>&2 $show "$relink_command" if $run eval "$relink_command"; then : else $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 continue fi fi # See the names of the shared library. set dummy $library_names if test -n "$2"; then realname="$2" shift shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. $show "$install_prog $dir/$srcname $destdir/$realname" $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? if test -n "$stripme" && test -n "$striplib"; then $show "$striplib $destdir/$realname" $run eval "$striplib $destdir/$realname" || exit $? fi 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\" 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"` ;; *.$objext) 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 notinst_deplibs= 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 "$notinst_deplibs"; then $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 exit 1 fi finalize=yes for lib in $notinst_deplibs; 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'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 finalize=no fi done relink_command= # If there is no directory component, then add one. case $file in */* | *\\*) . $file ;; *) . ./$file ;; esac 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=`mktemp -d $tmpdir/libtool-XXXXXX 2> /dev/null` if test $? = 0 ; then : else tmpdir="$tmpdir/libtool-$$" fi if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : else $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 continue fi file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` 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 # remove .exe since cygwin /usr/bin/install will append another # one anyways case $install_prog,$host in /usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) destfile=`echo $destfile | sed -e 's,.exe$,,'` ;; esac ;; esac $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 $? if test -n "$stripme" && test -n "$striplib"; then $show "$old_striplib $oldlib" $run eval "$old_striplib $oldlib" || exit $? fi # Do each command in the postinstall commands. eval cmds=\"$old_postinstall_cmds\" 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_cmd='$SHELL $0 --finish$current_libdirs' else exit 0 fi ;; # 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\" 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 the \`-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 prepare to actually exec the command. exec_cmd="\$cmd$args" 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 clean and uninstall mode clean | uninstall) modename="$modename: $mode" rm="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) rm="$rm $arg"; rmforce=yes ;; -*) 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 rmdirs= for file in $files; do dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` if test "X$dir" = "X$file"; then dir=. objdir="$objdir" else objdir="$dir/$objdir" fi name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if (test -L "$file") >/dev/null 2>&1 \ || (test -h "$file") >/dev/null 2>&1 \ || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi 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 $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" if test "$mode" = uninstall; then if test -n "$library_names"; then # Do each command in the postuninstall commands. eval cmds=\"$postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. eval cmds=\"$old_postuninstall_cmds\" save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" $show "$cmd" $run eval "$cmd" if test "$?" -ne 0 && test "$rmforce" != yes; then exit_status=1 fi done IFS="$save_ifs" fi # FIXME: should reinstall the best remaining shared library. fi fi ;; *.lo) if test "$build_old_libs" = yes; then oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` rmfiles="$rmfiles $dir/$oldobj" fi ;; *) # Do a test to see if this is a libtool program. if test "$mode" = clean && (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then relink_command= . $dir/$file rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi fi ;; esac $show "$rm $rmfiles" $run $rm $rmfiles || exit_status=1 done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then $show "rmdir $dir" $run rmdir $dir >/dev/null 2>&1 fi done exit $exit_status ;; "") $echo "$modename: you must specify a MODE" 1>&2 $echo "$generic_help" 1>&2 exit 1 ;; esac if test -z "$exec_cmd"; then $echo "$modename: invalid operation mode \`$mode'" 1>&2 $echo "$generic_help" 1>&2 exit 1 fi fi # test -z "$show_help" if test -n "$exec_cmd"; then eval exec $exec_cmd exit 1 fi # 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: clean remove files from the build directory 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 ;; clean) $echo \ "Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build 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, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; 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 -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -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-fast-install disable the fast-install mode -no-install link a not-installable executable -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: gdome2-0.8.1/missing0000755000000000000000000001451007437370271007736 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 2001 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 # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.in; then configure_ac=configure.ac else configure_ac=configure.in 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_ac'. 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_ac'. 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_ac'. 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_ac` 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_ac'. 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 gdome2-0.8.1/mkinstalldirs0000755000000000000000000000132207437370271011142 #! /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 gdome2-0.8.1/MAINTAINERS0000664000076400007640000000004407257377706010107 Paolo Casarini gdome2-0.8.1/gdomeConf.sh.in0000664000076400007640000000027007257334735011250 # # Configuration file for using the gdome library # GDOME_LIBDIR="@GDOME_LIBDIR@" GDOME_LIBS="@GDOME_LIBS@" GDOME_INCLUDEDIR="@GDOME_INCLUDEDIR@" MODULE_VERSION="@PACKAGE@-@VERSION@" gdome2-0.8.1/gdome2.spec0000664000076400007640000000760007740102217010424 %define nam gdome2 %define ver 0.8.1 %define rel 1 Summary: DOM level2 library for accessing XML files Name: %nam Version: %ver Release: %rel License: LGPL Group: Development/Libraries URL: http://gdome2.cs.unibo.it/ Source: http://gdome2.cs.unibo.it/tarball/%{nam}-%{ver}.tar.gz BuildRoot: /var/tmp/%{nam}-%{ver}-root BuildRequires: libxml2-devel >= 2.4.26 BuildRequires: glib2 >= 2.2.0 Requires: glib2 >= 2.2.0 Requires: libxml2 >= 2.4.26 %description gdome2 is a fast, light and complete DOM level2 implementation based on libxml2. Although it has been written for the GNOME project, it can be used stand-alone. A DOM implementation (also called a host implementation) is what makes a parsed XML or HTML document available for processing via the DOM interface. gdome2 currently supports the "Core", "XML", "Events" and "MutationEvents" modules from the DOM2 Recommendation (see http://www.w3.org/TR/DOM-Level-2-Core/ and http://www.w3.org/TR/DOM-L evel-2-Events/), and is supposed to become a full implementation of all the DOM Level2 standard. Now gdome2 also partially supports the XPath module from the DOM level 3 drafts. %package devel Summary: Development files for gdome2 Group: Development/Libraries Requires: gdome2 = %{ver} Requires: glib2-devel >= 2.2.0 Requires: libxml2-devel >= 2.4.26 %description devel This package contains the header files and static libraries for developing with gdome2. gdome2 is a fast, light and complete DOM level2 implementation based on libxml2. Although it has been written for the GNOME project, it can be used stand-alone. A DOM implementation (also called a host implementation) is what makes a parsed XML or HTML document available for processing via the DOM interface. gdome2 currently supports the "Core", "XML", "Events" and "MutationEvents" modules from the DOM2 Recommendation (see http://www.w3.org/TR/DOM-Level-2-Core/ and http://www.w3.org/TR/DOM-L evel-2-Events/), and is supposed to become a full implementation of all the DOM Level2 standard. Now gdome2 also partially supports the XPath module from the DOM level 3 drafts. %changelog * Sun Oct 05 2003 Paolo Casarini - fixed dependencies * Sun Dec 29 2002 Paolo Casarini patch provided by Oron Peled - %defattr(-,root,root) wasn't set for documents in the devel package. This cause wrong ownership of docs in non-root builds. - Update URL: and Source: locations - s/Copyright:/License:/ * Sun Mar 31 2002 Paolo Casarini - updated descriptions and summaries * Sat Dec 15 2001 Paolo Casarini - updated descriptions and summaries * Tue Oct 23 2001 Paolo Casarini - added the gdome-config.1 man page * Mon Aug 6 2001 Paolo Casarini - Merge of the Andrew release with mine * Thu Aug 2 2001 Andrew Chatham - Spec file created * Tue Jul 3 2001 Paolo Casarini - Initial release %prep %setup -q %build if [ ! -f configure ]; then ./autogen.sh --prefix=%{_prefix} --localstatedir=/var/lib fi %configure --localstatedir=/var/lib if [ "$SMP" != "" ]; then (make "MAKE=make -k -j $SMP"; exit 0) make else make fi make %install rm -rf $RPM_BUILD_ROOT %makeinstall %clean rm -rf $RPM_BUILD_ROOT %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %defattr(-, root, root) %doc AUTHORS MAINTAINERS ChangeLog INSTALL NEWS README COPYING COPYING.LIB %{_libdir}/lib*.so.* %files devel %defattr(-, root, root) %doc gtk-doc/html/*.html %doc %{_prefix}/share/man/man1/gdome-config.1* %{_bindir}/gdome-config %{_includedir}/* %{_libdir}/lib*.so %{_libdir}/*a %{_libdir}/*.sh %{_prefix}/share/aclocal/gdome2.m4 %{_libdir}/pkgconfig/gdome2.pc gdome2-0.8.1/gdome2.m40000664000076400007640000000063507606515342010023 # GDOME2_DEFS([GDOME2_REQS=gdome2]) # --------------------------------------- AC_DEFUN([GDOME2_DEFS], [ dnl Import gdome2 data PKG_CHECK_MODULES(GDOME2,m4_default([$1], gdome2)) AC_SUBST(GDOME2_CFLAGS) AC_SUBST(GDOME2_LIBS) dnl Example for exporting other variables read from pkg-config dnl foodir=`$PKG_CONFIG --variable=foodir "gdome2"` dnl AC_SUBST(foodir) ]) gdome2-0.8.1/gdome-config.10000664000076400007640000000321307740102217011007 .TH GDOME2 1 "3 December 2001" Version 0.8.1 .SH NAME gdome-config - script to get information about the installed version of gdome2 .SH SYNOPSIS .B gdome-config [\-\-prefix\fI[=DIR]\fP] [\-\-exec-prefix\fI[=DIR]\fP] [\-\-libs] [\-\-cflags] [\-\-version] [\-\-help] .SH DESCRIPTION \fIgdome-config\fP is a tool that is used to determine the compile and linker flags that should be used to compile and link programs that use \fIgdome2\fP. .SH OPTIONS .l \fIgdome-config\fP accepts the following options: .TP 8 .B \-\-version Print the currently installed version of \fIgdome2\fP on the standard output. .TP 8 .B \-\-libs Print the linker flags that are necessary to link a \fIgdome2\fP program. .TP 8 .B \-\-cflags Print the compiler flags that are necessary to compile a \fIgdome2\fP program. .TP 8 .B \-\-prefix=DIR If specified, use DIR instead of the installation prefix that \fIgdome2\fP was built with when computing the output for the \-\-cflags and \-\-libs options. This option must be specified before any \-\-libs or \-\-cflags options. .TP 8 .B \-\-exec-prefix=DIR If specified, use DIR instead of the installation exec prefix that \fIgdome2\fP was built when computing the output for the \-\-cflags and \-\-libs options. This option must be specified before any \-\-libs or \-\-cflags options. .TP 8 .B \-\-help Print a short help text and exit. .SH AUTHOR This manual page was added by Enrico Zini for the Debian GNU/Linux system (but may be used by others). The page was made editing the manpage written by Fredrik Hallenberg for the libxml2 Debian GNU/Linux package. gdome2-0.8.1/README.developer0000664000076400007640000000344207437311613011244 ============================================================= How to add a module to gdome2 ============================================================= 1. Create a directory under libgdome with the name of your module, e.g. events, xpath. This will be the directory where the "private" code resides for your module. The files in libgdome implement the "public" interface. 2. Create an automake Makefile.am file in the newly created directory. The makefile will be automatically generated from this file when you run autogen.sh. 3. Create an XML file for the interface specification in test/apigen. For example events.xml and xpath.xml are used to generate gdome-events.c and gdome-xpath.c in libgdome by running test/apigen/apigen. 4. Create a header file in libgdome. This file will contain "public" functions. For example, see gdome-events.h and gdome-xpath.h. ============================================================= How to add gtk documentation for a new module ============================================================= 1. cd to gtk-doc dir 2. add in the gtk-doc/Makefile.am in the scan target $(DOC_SOURCE_DIR)/.h 3. rebuild gtk-doc/Makefile.in and gtk-doc/Makefile by running autogen.sh in root dir. cd back to gtk-doc dir 4. run make templates 5. now you have a new file called gdome2-unused.txt open it the move the items that you want to document in the gdome2-sections.txt you'll have to add SECTION tags for each new interface implemented don't worry if in the gdome2-unused.txt you leave some rows... 6. run make templates 7. then you have to edit by hand the gdome2-docs.sgml w.r.t. the gtk-doc/tmpl new files created 8. edit the new gtk-doc/tmpl files adding general documentation on interfaces 9. run make sgml 10. run make html (this takes a while) gdome2-0.8.1/libgdome/0000777000076400007640000000000007740102241010231 5gdome2-0.8.1/libgdome/Makefile.in0000664000076400007640000003313407740102237012225 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EXEEXT = @EXEEXT@ GDOME_INCLUDEDIR = @GDOME_INCLUDEDIR@ GDOME_LIBDIR = @GDOME_LIBDIR@ GDOME_LIBS = @GDOME_LIBS@ GDOME_VERSION_INFO = @GDOME_VERSION_INFO@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MIN_VERSION = @GLIB_MIN_VERSION@ GLIB_MKENUMS = @GLIB_MKENUMS@ GLIB_REQUIRED = @GLIB_REQUIRED@ GOBJECT_QUERY = @GOBJECT_QUERY@ HTML_DIR = @HTML_DIR@ LDFLAGS = @LDFLAGS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_MIN_VERSION = @XML_MIN_VERSION@ NULL = SUBDIRS = \ gdomecore \ events \ xpath \ $(NULL) INCLUDES = \ -I$(top_srcdir)/libgdome \ -I$(top_srcdir)/libgdome/gdomecore \ -I$(top_srcdir)/libgdome/events \ -I$(top_srcdir)/libgdome/xpath \ $(LIBXML_CFLAGS) $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) lib_LTLIBRARIES = libgdome.la libgdome_la_SOURCES = \ gdome.c \ gdome-events.c \ gdome-xpath.c \ gdome-util.c \ gdome-private-list.c \ gdome-refdebug.c \ gdome-treegc.c \ $(NULL) libgdome_la_LIBADD = \ $(top_builddir)/libgdome/gdomecore/libgdomecore.la \ $(top_builddir)/libgdome/events/libgdomeevents.la \ $(top_builddir)/libgdome/xpath/libgdomexpath.la \ $(LIBXML_LIBS) \ $(GLIB_LIBS) \ $(NULL) libgdome_la_LDFLAGS = -version-info @GDOME_VERSION_INFO@ # what is this include dir ? libgdomeincdir = $(includedir)/libgdome libgdomeinc_HEADERS = \ gdome.h \ gdome-events.h \ gdome-xpath.h \ gdome-util.h \ gdome-private-list.h \ gdome-refdebug.h \ gdome-treegc.h \ gdome-libxml-util.h \ $(NULL) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(lib_LTLIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) -I.. LIBS = @LIBS@ libgdome_la_DEPENDENCIES = \ $(top_builddir)/libgdome/gdomecore/libgdomecore.la \ $(top_builddir)/libgdome/events/libgdomeevents.la \ $(top_builddir)/libgdome/xpath/libgdomexpath.la libgdome_la_OBJECTS = gdome.lo gdome-events.lo gdome-xpath.lo \ gdome-util.lo gdome-private-list.lo gdome-refdebug.lo gdome-treegc.lo 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 = $(libgdomeinc_HEADERS) DIST_COMMON = Makefile.am Makefile.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = gtar GZIP_ENV = --best SOURCES = $(libgdome_la_SOURCES) OBJECTS = $(libgdome_la_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps libgdome/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 $< # FIXME: We should only use cygpath when building on Windows, # and only if it is available. .c.obj: $(COMPILE) -c `cygpath -w $<` .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core -rm -f *.$(OBJEXT) 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: libgdome.la: $(libgdome_la_OBJECTS) $(libgdome_la_DEPENDENCIES) $(LINK) -rpath $(libdir) $(libgdome_la_LDFLAGS) $(libgdome_la_OBJECTS) $(libgdome_la_LIBADD) $(LIBS) install-libgdomeincHEADERS: $(libgdomeinc_HEADERS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libgdomeincdir) @list='$(libgdomeinc_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libgdomeincdir)/$$p"; \ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(libgdomeincdir)/$$p; \ done uninstall-libgdomeincHEADERS: @$(NORMAL_UNINSTALL) list='$(libgdomeinc_HEADERS)'; for p in $$list; do \ rm -f $(DESTDIR)$(libgdomeincdir)/$$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 = libgdome 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-libLTLIBRARIES install-exec: install-exec-recursive install-data-am: install-libgdomeincHEADERS install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall-libLTLIBRARIES uninstall-libgdomeincHEADERS uninstall: uninstall-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) all-redirect: all-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(libgdomeincdir) 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-recursive clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \ clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-libLTLIBRARIES distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-recursive 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-recursive .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-libgdomeincHEADERS \ install-libgdomeincHEADERS 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: gdome2-0.8.1/libgdome/Makefile.am0000664000076400007640000000231507515025234012212 NULL = SUBDIRS = \ gdomecore \ events \ xpath \ $(NULL) INCLUDES = \ -I$(top_srcdir)/libgdome \ -I$(top_srcdir)/libgdome/gdomecore \ -I$(top_srcdir)/libgdome/events \ -I$(top_srcdir)/libgdome/xpath \ $(LIBXML_CFLAGS) $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) lib_LTLIBRARIES = libgdome.la libgdome_la_SOURCES = \ gdome.c \ gdome-events.c \ gdome-xpath.c \ gdome-util.c \ gdome-private-list.c \ gdome-refdebug.c \ gdome-treegc.c \ $(NULL) libgdome_la_LIBADD = \ $(top_builddir)/libgdome/gdomecore/libgdomecore.la \ $(top_builddir)/libgdome/events/libgdomeevents.la \ $(top_builddir)/libgdome/xpath/libgdomexpath.la \ $(LIBXML_LIBS) \ $(GLIB_LIBS) \ $(NULL) libgdome_la_LDFLAGS = -version-info @GDOME_VERSION_INFO@ # what is this include dir ? libgdomeincdir = $(includedir)/libgdome libgdomeinc_HEADERS = \ gdome.h \ gdome-events.h \ gdome-xpath.h \ gdome-util.h \ gdome-private-list.h \ gdome-refdebug.h \ gdome-treegc.h \ gdome-libxml-util.h \ $(NULL) gdome2-0.8.1/libgdome/gdome.c0000664000076400007640000176705407737315573011456 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * CopyRight (C) 2001 Paolo Casarini * * This file is generated automatically. To make changes, edit * test/apigen/core.xml * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "gdome.h" #include "gdome-xml-str.h" #include "gdome-xml-domimpl.h" #include "gdome-xml-nnodem.h" #include "gdome-xml-nodel.h" #include "gdome-xml-domimpl.h" #include "gdome-xml-node.h" #include "gdome-xml-cdata.h" #include "gdome-xml-text.h" #include "gdome-xml-cdatas.h" #include "gdome-xml-comment.h" #include "gdome-xml-document.h" #include "gdome-xml-documentf.h" #include "gdome-xml-documentt.h" #include "gdome-xml-attribute.h" #include "gdome-xml-element.h" #include "gdome-xml-entity.h" #include "gdome-xml-entityref.h" #include "gdome-xml-pi.h" #include "gdome-xml-xmldtdutil.h" #include "gdome-xml-notation.h" #include "gdome-xml-xpns.h" /****************************************************************************** GdomeDOMString interface API ******************************************************************************/ /** * gdome_str_mkref: * @str: a %NULL terminated string * * Creates a #GdomeDOMString from a statically allocated string. * Returns: the new DOMString object. */ GdomeDOMString * gdome_str_mkref (const gchar *str) { return gdome_xml_str_mkref (str); } /** * gdome_str_mkref_own: * @str: a %NULL terminated string * * Creates a #GdomeDOMString from a dynamically allocated gchar buffer. * Returns: the new DOMString object. */ GdomeDOMString * gdome_str_mkref_own (gchar *str) { return gdome_xml_str_mkref_own (str); } /** * gdome_str_mkref_xml: * @str: a %NULL terminated string * * Creates a #GdomeDOMString from a xmlChar buffer already allocated by libxml. * DEPRECATED * Returns: the new DOMString object. */ GdomeDOMString * gdome_str_mkref_xml (xmlChar *str) { return gdome_xml_str_mkref_xml (str); } /** * gdome_str_mkref_dup: * @str: a %NULL terminated string * * Creates a #GdomeDOMString from a static or dynamically allocated gchar * buffer, but a copy of the initializing string is done before construction. * Returns: the new DOMString object. */ GdomeDOMString * gdome_str_mkref_dup (const gchar *str) { return gdome_xml_str_mkref_dup (str); } /** * gdome_str_ref: * @self: DOMString Object ref * * Increase the reference count of the specified #GdomeDOMString. */ void gdome_str_ref (GdomeDOMString *self) { gdome_xml_str_ref (self); } /** * gdome_str_unref: * @self: DOMString Object ref * * Decrease the reference count of the specified #GdomeDOMString. Free the * structure if the object will have zero reference. */ void gdome_str_unref (GdomeDOMString *self) { gdome_xml_str_unref (self); } /** * gdome_str_equal: * @self: DOMString Object ref * @str: DOMString to be compared * * Returns: %TRUE if the strings are equal, %FALSE otherwise. */ GdomeBoolean gdome_str_equal (GdomeDOMString *self, GdomeDOMString *str) { return gdome_xml_str_equal (self, str); } /** * gdome_str_equalIgnoreCase: * @self: DOMString Object ref * @str: DOMString to be compared * * Returns: %TRUE if the strings are equal ignoring case, %FALSE otherwise. */ GdomeBoolean gdome_str_equalIgnoreCase (GdomeDOMString *self, GdomeDOMString *str) { return gdome_xml_str_equalIgnoreCase (self, str); } /** * gdome_str_charAt: * @self: DOMString Object ref * @index: the index of the character wanted * * Returns: the @index -th character in the specified string */ gchar gdome_str_charAt (GdomeDOMString *self, int index) { return gdome_xml_str_charAt (self, index); } /** * gdome_str_concat: * @self: DOMString Object ref * @str: DOMString to be appended * * Returns: a new #GdomeDOMString that is the concatenation of this string * with @str. If @str is %NULL a new reference to this string is returned. */ GdomeDOMString * gdome_str_concat (GdomeDOMString *self, GdomeDOMString *str) { return gdome_xml_str_concat (self, str); } /** * gdome_str_isEmpty: * @self: DOMString Object ref * * Returns: %TRUE if this string is empty, %FALSE otherwise. */ GdomeBoolean gdome_str_isEmpty (GdomeDOMString *self) { return gdome_xml_str_isEmpty (self); } /** * gdome_str_endsWith: * @self: DOMString Object ref * @suffix: DOMString to check * * Returns: %TRUE if this string ends with @str. */ GdomeBoolean gdome_str_endsWith (GdomeDOMString *self, GdomeDOMString *suffix) { return gdome_xml_str_endsWith (self, suffix); } /** * gdome_str_startsWith: * @self: DOMString Object ref * @prefix: DOMString to check * * Returns: %TRUE if this string starts with @str. */ GdomeBoolean gdome_str_startsWith (GdomeDOMString *self, GdomeDOMString *prefix) { return gdome_xml_str_startsWith (self, prefix); } /** * gdome_str_length: * @self: DOMString Object ref * * Returns: the length of this string. */ int gdome_str_length (GdomeDOMString *self) { return gdome_xml_str_length (self); } /****************************************************************************** GdomeDOMImplementation interface API ******************************************************************************/ /** * gdome_di_mkref: * * Constructor of the DOMImplementation interface. * Returns: the reference to the DOMImplementation structure. */ GdomeDOMImplementation * gdome_di_mkref (void) { return gdome_xml_di_mkref (); } /** * gdome_di_ref: * @self: DOMImplementation Object ref * @exc: Exception Object ref * * Increase the reference count of the DOMImplementation structure. */ void gdome_di_ref (GdomeDOMImplementation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_xml_DOMImplementation *)self)->vtab->ref (self, exc); } /** * gdome_di_unref: * @self: DOMImplementation Object ref * @exc: Exception Object ref * * Decrease the reference count of the DOMImplementation. Free the structure * if DOMImplementation will have zero reference. */ void gdome_di_unref (GdomeDOMImplementation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_xml_DOMImplementation *)self)->vtab->unref (self, exc); } /** * gdome_di_query_interface: * @self: DOMImplementation Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_di_query_interface (GdomeDOMImplementation *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->query_interface (self, interface, exc); } /** * gdome_di_createDocument: * @self: DOMImplementation Object ref * @namespaceURI: The namespace URI of the document element to create * @qualifiedName: The qualified name of the document element to be created * @doctype: The type of document to be created or NULL * @exc: Exception Object ref * * Creates an XML Document object of the specified type with its document * element. * * %GDOME_NAMESPACE_ERR: Raised if the @qualifiedName is malformed, if the * @qualifiedName has a prefix and the @namespaceURI is %NULL, or if the * @qualifiedName has a prefix that is "xml" and the @namespaceURI is different * from "http://www.w3.org/XML/1998/namespace" * %GDOME_WRONG_DOCUMENT_ERR: Raised if @doctype has already been used with a * different document. * Returns: a new Document node. */ GdomeDocument * gdome_di_createDocument (GdomeDOMImplementation *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeDocumentType *doctype, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->createDocument (self, namespaceURI, qualifiedName, doctype, exc); } /** * gdome_di_createDocumentType: * @self: The DOMImplementation Object ref * @qualifiedName: The qualified name of the document type to be created * @publicID: The external subset public identifier * @systemID: The external subset system identifier * @exc: The Exception Object ref * * Creates an empty DocumentType node. Entity declarations and notations are * not made available. Entity reference expansions and default attribute * additions do not occur. It is expected that a future version of the DOM will * provide a way for populating a DocumentType. * * %GDOME_NAMESPACE_ERR: Raised if the qualifiedName is malformed. * Returns: A new DocumentType node. */ GdomeDocumentType * gdome_di_createDocumentType (GdomeDOMImplementation *self, GdomeDOMString *qualifiedName, GdomeDOMString *publicId, GdomeDOMString *systemId, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->createDocumentType (self, qualifiedName, publicId, systemId, exc); } /** * gdome_di_hasFeature: * @self: The DOMImplementation Object ref * @feature: The name of the feature to test (case-insensitive). * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature. * Returns: %TRUE if the feature is supported, %FALSE otherwise. */ GdomeBoolean gdome_di_hasFeature (GdomeDOMImplementation *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->hasFeature (self, feature, version, exc); } /** * gdome_di_freeDoc: * @self: DOMImplementation Object ref * @doc: The Document Object ref to be freed * @exc: Exception Object ref * * DEPRECATED! * Free all objects and structures associated to the Document specified. */ void gdome_di_freeDoc (GdomeDOMImplementation *self, GdomeDocument *doc, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_xml_DOMImplementation *)self)->vtab->freeDoc (self, doc, exc); } /** * gdome_di_createDocFromURI: * @self: DOMImplementation Object ref * @uri: the uri of XML file to load * @mode: specifies if the document is to be parsed, validated or recovered * and if the entity substitution has to be done. * @exc: Exception Object ref * * Loads a XML Document from a URI and build a DOM tree. If @mode is * %GDOME_LOAD_PARSING the document must be well formed, if @mode is * %GDOME_LOAD_VALIDATING the document must valid and if @mode is * %GDOME_LOAD_RECOVERING a tree is built anyway. * If the %GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is * performed (es. @mode = %GDOME_LOAD_PARSING | %GDOME_LOAD_SUBSTITUTE_ENTITIES * ). * If the %GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated * with default attributes from the DTD. * Returns: The Document Object of the created tree or %NULL if an error occur. */ GdomeDocument * gdome_di_createDocFromURI (GdomeDOMImplementation *self, const char *uri, unsigned int mode, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->createDocFromURI (self, uri, mode, exc); } /** * gdome_di_createDocFromMemory: * @self: DOMImplementation Object ref * @buffer: a pointer to char array that holds the XML document * @mode: specifies if the document is to be parsed, validated or recovered * and if the entity substitution has to be done. * @exc: Exception Object ref * * Loads a XML Document from a memory buffer and build a DOM tree. If @mode is * %GDOME_LOAD_PARSING the document must be well formed, if @mode is * %GDOME_LOAD_VALIDATING the document must valid and if @mode is * %GDOME_LOAD_RECOVERING a tree is built anyway. * If the %GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is * performed (es. @mode = %GDOME_LOAD_PARSING | %GDOME_LOAD_SUBSTITUTE_ENTITIES * ). * If the %GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated * with default attributes from the DTD. * Returns: The Document Object of the created tree or %NULL if an error occur. */ GdomeDocument * gdome_di_createDocFromMemory (GdomeDOMImplementation *self, char *buffer, unsigned int mode, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->createDocFromMemory (self, buffer, mode, exc); } /** * gdome_di_createDocFromURIWithEntitiesTable: * @self: DOMImplementation Object ref * @uri: the uri of XML file to load * @entityTable: array of #GdomeEntitiesTableEntry that define name, value, * publicID ans systemID of entities used but not declared * in DTD. The array must be NULL terminated. * @mode: specifies if the document is to be parsed, validated or recovered * and if the entity substitution has to be done. * @exc: Exception Object ref * * Loads a XML Document using also entity declaration specified in @entityTable * from a URI and build a DOM tree. If @mode is %GDOME_LOAD_PARSING the * document must be well formed, if @mode is %GDOME_LOAD_VALIDATING the * document must valid and if @mode is %GDOME_LOAD_RECOVERING a tree is built * anyway. * If the %GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is * performed (es. @mode = %GDOME_LOAD_PARSING | %GDOME_LOAD_SUBSTITUTE_ENTITIES * ). * If the %GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated * with default attributes from the DTD. * Returns: The Document Object of the created tree or %NULL if an error occur. */ GdomeDocument * gdome_di_createDocFromURIWithEntitiesTable (GdomeDOMImplementation *self, const char *uri, const GdomeEntitiesTableEntry entityTable[], unsigned int mode, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->createDocFromURIWithEntitiesTable (self, uri, entityTable, mode, exc); } /** * gdome_di_createDocFromMemoryWithEntitiesTable: * @self: DOMImplementation Object ref * @buffer: a pointer to char array that holds the XML document * @entityTable: array of #GdomeEntitiesTableEntry that define name, value, * publicID ans systemID of entities used but not declared * in DTD. The array must be NULL terminated. * @mode: specifies if the document is to be parsed, validated or recovered * and if the entity substitution has to be done. * @exc: Exception Object ref * * Loads a XML Document using also entity declaration specified in @entityTable * from a memory buffer and build a DOM tree. If @mode is %GDOME_LOAD_PARSING * the document must be well formed, if @mode is %GDOME_LOAD_VALIDATING the * document must valid and if @mode is %GDOME_LOAD_RECOVERING a tree is built * anyway. * If the %GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is * performed (es. @mode = %GDOME_LOAD_PARSING | %GDOME_LOAD_SUBSTITUTE_ENTITIES * ). * If the %GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated * with default attributes from the DTD. * Returns: The Document Object of the created tree or %NULL if an error occur. */ GdomeDocument * gdome_di_createDocFromMemoryWithEntitiesTable (GdomeDOMImplementation *self, char *buffer, const GdomeEntitiesTableEntry entityTable[], unsigned int mode, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->createDocFromMemoryWithEntitiesTable (self, buffer, entityTable, mode, exc); } /** * gdome_di_saveDocToFile: * @self: DOMImplementation Object ref * @doc: the Document of which the tree is wanted to be saved * @filename: the XML filename to save * @mode: the indentation mode wanted * @exc: Exception Object ref * * Save the DOM tree of the Document specified to file. * Returns: %FALSE in case of failure, %TRUE otherwise. */ GdomeBoolean gdome_di_saveDocToFile (GdomeDOMImplementation *self, GdomeDocument *doc, const char *filename, GdomeSavingCode mode, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->saveDocToFile (self, doc, filename, mode, exc); } /** * gdome_di_saveDocToFileEnc: * @self: DOMImplementation Object ref * @doc: the Document of which the tree is wanted to be saved * @filename: the XML filename to save * @encoding: character encoding to use when generating XML text * @mode: the indentation mode wanted * @exc: Exception Object ref * * Save the DOM tree of the Document specified to file with the specified * Character encoding. * Returns: %FALSE in case of failure, %TRUE otherwise. */ GdomeBoolean gdome_di_saveDocToFileEnc (GdomeDOMImplementation *self, GdomeDocument *doc, const char *filename, const char *encoding, GdomeSavingCode mode, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->saveDocToFileEnc (self, doc, filename, encoding, mode, exc); } /** * gdome_di_saveDocToMemory: * @self: DOMImplementation Object ref * @doc: the Document of which the tree is wanted to be saved * @mem: the memory pointer where the saved document is returned * @mode: the indentation mode wanted * @exc: Exception Object ref * * Save the DOM tree of the Document specified to a new allocated memory and * return it in the @mem pointer. * Returns: %FALSE in case of failure, %TRUE otherwise. */ GdomeBoolean gdome_di_saveDocToMemory (GdomeDOMImplementation *self, GdomeDocument *doc, char **mem, GdomeSavingCode mode, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->saveDocToMemory (self, doc, mem, mode, exc); } /** * gdome_di_saveDocToMemoryEnc: * @self: DOMImplementation Object ref * @doc: the Document of which the tree is wanted to be saved * @mem: the memory pointer where the saved document is returned * @encoding: character encoding to use when generating XML text * @mode: the indentation mode wanted * @exc: Exception Object ref * * Save the DOM tree of the Document specified using the specified character * encoding standard to a new allocated memory and return it in the @mem * pointer. * Returns: %FALSE in case of failure, %TRUE otherwise. */ GdomeBoolean gdome_di_saveDocToMemoryEnc (GdomeDOMImplementation *self, GdomeDocument *doc, char **mem, const char *encoding, GdomeSavingCode mode, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->saveDocToMemoryEnc (self, doc, mem, encoding, mode, exc); } /** * gdome_di_enableEvent: * @self: DOMImplementation Object ref * @doc: the Document on which we want to enable events * @name: the name of the event type to enable * @exc: Exception Object ref * * Enables the propagation of the event type specified. */ void gdome_di_enableEvent (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_xml_DOMImplementation *)self)->vtab->enableEvent (self, doc, name, exc); } /** * gdome_di_disableEvent: * @self: DOMImplementation Object ref * @doc: the Document on which we want to disable events * @name: the name of the event type to disable * @exc: Exception Object ref * * Disables the propagation of the event type specified. */ void gdome_di_disableEvent (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_xml_DOMImplementation *)self)->vtab->disableEvent (self, doc, name, exc); } /** * gdome_di_eventIsEnabled: * @self: DOMImplementation Object ref * @doc: the Document on which we want to make the check * @name: the name of the event type to check * @exc: Exception Object ref * * Checks if the specified event type is enabled. * Returns: %TRUE if the event type specified is enabled, %FALSE otherwise. */ GdomeBoolean gdome_di_eventIsEnabled (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DOMImplementation *)self)->vtab->eventIsEnabled (self, doc, name, exc); } /****************************************************************************** GdomeNode interface API ******************************************************************************/ /** * gdome_n_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_n_attributes (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->attributes (self, exc); } /** * gdome_n_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_n_childNodes (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->childNodes (self, exc); } /** * gdome_n_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_n_firstChild (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->firstChild (self, exc); } /** * gdome_n_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_n_lastChild (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->lastChild (self, exc); } /** * gdome_n_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_n_localName (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->localName (self, exc); } /** * gdome_n_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_n_namespaceURI (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->namespaceURI (self, exc); } /** * gdome_n_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_n_nextSibling (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->nextSibling (self, exc); } /** * gdome_n_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_n_nodeName (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->nodeName (self, exc); } /** * gdome_n_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_n_nodeType (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->nodeType (self, exc); } /** * gdome_n_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_n_nodeValue (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->nodeValue (self, exc); } /** * gdome_n_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_n_set_nodeValue (GdomeNode *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Node *)self)->vtab->set_nodeValue (self, nodeValue, exc); } /** * gdome_n_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_n_ownerDocument (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->ownerDocument (self, exc); } /** * gdome_n_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_n_parentNode (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->parentNode (self, exc); } /** * gdome_n_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_n_prefix (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->prefix (self, exc); } /** * gdome_n_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_n_set_prefix (GdomeNode *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Node *)self)->vtab->set_prefix (self, prefix, exc); } /** * gdome_n_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_n_previousSibling (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->previousSibling (self, exc); } /** * gdome_n_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_n_ref (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Node *)self)->vtab->ref (self, exc); } /** * gdome_n_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_n_unref (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_Node *)self)->vtab->unref (self, exc); } /** * gdome_n_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_n_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->query_interface (self, interface, exc); } /** * gdome_n_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_n_appendChild (GdomeNode *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->appendChild (self, newChild, exc); } /** * gdome_n_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_n_cloneNode (GdomeNode *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->cloneNode (self, deep, exc); } /** * gdome_n_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_n_hasAttributes (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->hasAttributes (self, exc); } /** * gdome_n_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_n_hasChildNodes (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->hasChildNodes (self, exc); } /** * gdome_n_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_n_insertBefore (GdomeNode *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->insertBefore (self, newChild, refChild, exc); } /** * gdome_n_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_n_isSupported (GdomeNode *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->isSupported (self, feature, version, exc); } /** * gdome_n_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_n_normalize (GdomeNode *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Node *)self)->vtab->normalize (self, exc); } /** * gdome_n_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_n_removeChild (GdomeNode *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->removeChild (self, oldChild, exc); } /** * gdome_n_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_n_replaceChild (GdomeNode *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->replaceChild (self, newChild, oldChild, exc); } /** * gdome_n_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_n_addEventListener (GdomeNode *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Node *)self)->vtab->addEventListener (self, type, listener, useCapture, exc); } /** * gdome_n_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_n_removeEventListener (GdomeNode *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Node *)self)->vtab->removeEventListener (self, type, listener, useCapture, exc); } /** * gdome_n_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_n_dispatchEvent (GdomeNode *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->dispatchEvent (self, evt, exc); } /** * gdome_n_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_n_subTreeDispatchEvent (GdomeNode *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Node *)self)->vtab->subTreeDispatchEvent (self, evt, exc); } /** * gdome_n_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_n_canAppend (GdomeNode *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Node *)self)->vtab->canAppend (self, newChild, exc); } /****************************************************************************** GdomeDocumentFragment interface API ******************************************************************************/ /** * gdome_df_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_df_attributes (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.attributes ((GdomeNode *)self, exc); } /** * gdome_df_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_df_childNodes (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.childNodes ((GdomeNode *)self, exc); } /** * gdome_df_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_df_firstChild (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.firstChild ((GdomeNode *)self, exc); } /** * gdome_df_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_df_lastChild (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.lastChild ((GdomeNode *)self, exc); } /** * gdome_df_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_df_localName (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.localName ((GdomeNode *)self, exc); } /** * gdome_df_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_df_namespaceURI (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_df_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_df_nextSibling (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_df_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_df_nodeName (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.nodeName ((GdomeNode *)self, exc); } /** * gdome_df_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_df_nodeType (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.nodeType ((GdomeNode *)self, exc); } /** * gdome_df_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_df_nodeValue (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_df_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_df_set_nodeValue (GdomeDocumentFragment *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentFragment *)self)->vtab->super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_df_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_df_ownerDocument (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_df_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_df_parentNode (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.parentNode ((GdomeNode *)self, exc); } /** * gdome_df_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_df_prefix (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.prefix ((GdomeNode *)self, exc); } /** * gdome_df_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_df_set_prefix (GdomeDocumentFragment *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentFragment *)self)->vtab->super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_df_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_df_previousSibling (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_df_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_df_ref (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentFragment *)self)->vtab->super.ref ((GdomeNode *)self, exc); } /** * gdome_df_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_df_unref (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_DocumentFragment *)self)->vtab->super.unref ((GdomeNode *)self, exc); } /** * gdome_df_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_df_query_interface (GdomeDocumentFragment *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_df_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_df_appendChild (GdomeDocumentFragment *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_df_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_df_cloneNode (GdomeDocumentFragment *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_df_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_df_hasAttributes (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_df_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_df_hasChildNodes (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_df_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_df_insertBefore (GdomeDocumentFragment *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_df_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_df_isSupported (GdomeDocumentFragment *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_df_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_df_normalize (GdomeDocumentFragment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentFragment *)self)->vtab->super.normalize ((GdomeNode *)self, exc); } /** * gdome_df_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_df_removeChild (GdomeDocumentFragment *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_df_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_df_replaceChild (GdomeDocumentFragment *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_df_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_df_addEventListener (GdomeDocumentFragment *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentFragment *)self)->vtab->super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_df_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_df_removeEventListener (GdomeDocumentFragment *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentFragment *)self)->vtab->super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_df_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_df_dispatchEvent (GdomeDocumentFragment *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_df_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_df_subTreeDispatchEvent (GdomeDocumentFragment *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentFragment *)self)->vtab->super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_df_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_df_canAppend (GdomeDocumentFragment *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DocumentFragment *)self)->vtab->super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeDocument interface API ******************************************************************************/ /** * gdome_doc_doctype: * @self: Document Object ref * @exc: Exception Object ref * * Returns: The Document Type Declaration associated with this document. The * DOM Level 2 does not support editing the Document Type Declaration. docType * cannot be altered in any way, including through the use of methods inherited * from the Node interface, such as insertNode or removeNode. */ GdomeDocumentType * gdome_doc_doctype (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->doctype (self, exc); } /** * gdome_doc_documentElement: * @self: Document Object ref * @exc: Exception Object ref * * Returns: the root Element of the Document. */ GdomeElement * gdome_doc_documentElement (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->documentElement (self, exc); } /** * gdome_doc_implementation: * @self: Document Object ref * @exc: Exception Object ref * * Returns: the DOMImplementation object that handles this document. */ GdomeDOMImplementation * gdome_doc_implementation (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->implementation (self, exc); } /** * gdome_doc_createAttribute: * @self: Document Object ref * @name: The name of the attribute * @exc: Exception Object ref * * Creates an Attr of the given @name. Note that the Attr instance can then be * set on an Element using the setAttributeNode method. To create an attribute * with a qualified name and namespace URI, use the * gdome_doc_createAttributeNS() method. * Returns: a new Attr object with the nodeName attribute set to @name, and * localName, prefix, and namespaceURI set to %NULL. The value of the attribute * is the empty string. */ GdomeAttr * gdome_doc_createAttribute (GdomeDocument *self, GdomeDOMString *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->createAttribute (self, name, exc); } /** * gdome_doc_createAttributeNS: * @self: Document Object ref * @namespaceURI: The namespace URI of the attribute to create * @qualifiedName: The qualified name of the attribute to create * @exc: Exception Object ref * * Creates an attribute of the given qualified name and namespace URI. * * %GDOME_NAMESPACE_ERR: Raised if the @qualifiedName is malformed, if the * @qualifiedName has a prefix and the @namespaceURI is %NUKK, if the * @qualifiedName has a prefix that is "xml" and the @namespaceURI is different * from "http://www.w3.org/XML/1998/namespace", or if the @qualifiedName is * "xmlns" and the @namespaceURI is different from "http://www.w3.org/2000/xmlns/". * Returns: a new Attr object with the following attributes: * %Node.nodeName = @qualifiedName, * %Node.namespaceURI = @namespaceURI, * %Node.prefix = prefix, extracted from @qualifiedName, * %Node.localName = localName, extracted from @qualifiedName, * %Attr.name = @qualifiedName, * %Node.nodeValue = the empty string. */ GdomeAttr * gdome_doc_createAttributeNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->createAttributeNS (self, namespaceURI, qualifiedName, exc); } /** * gdome_doc_createCDATASection: * @self: Document Object ref * @data: The data for the CDATASection contents * @exc: Exception Object ref * * Creates a CDATASection node whose value is the specified string. * Returns: the new CDATASection object. */ GdomeCDATASection * gdome_doc_createCDATASection (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->createCDATASection (self, data, exc); } /** * gdome_doc_createComment: * @self: Document Object ref * @data: The data for the comment contents * @exc: Exception Object ref * * Creates a Comment node whose value is the specified string. * Returns: the new Comment object. */ GdomeComment * gdome_doc_createComment (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->createComment (self, data, exc); } /** * gdome_doc_createDocumentFragment: * @self: Document Object ref * @exc: Exception Object ref * * Creates an empty DocumentFragment object. * Returns: the new DocumentFragment object. */ GdomeDocumentFragment * gdome_doc_createDocumentFragment (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->createDocumentFragment (self, exc); } /** * gdome_doc_createElement: * @self: Document Object ref * @tagName: The name of the element type to instantiate. * @exc: Exception Object ref * * Creates an element of the type specified. Note that the instance returned * implements the Element interface, so attributes can be specified directly on * the returned object. * To create an element with a qualified name and namespace URI, use the * gdome_doc_createElementNS() function. * Returns: a new Element object with the nodeName attribute set to tagName, * and localName, prefix, and namespaceURI set to %NULL. */ GdomeElement * gdome_doc_createElement (GdomeDocument *self, GdomeDOMString *tagName, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->createElement (self, tagName, exc); } /** * gdome_doc_createElementNS: * @self: Document Object ref * @namespaceURI: The namespace URI of the element to create * @qualifiedName: The qualified name of the element to create * @exc: Exception Object ref * * Creates an element of the given qualified name and namespace URI. * * %GDOME_NAMESPACE_ERR: Raised if the @qualifiedName is malformed, if the * @qualifiedName has a prefix and the @namespaceURI is %NULL, or if the * @qualifiedName has a prefix that is "xml" and the @namespaceURI is different * from "http://www.w3.org/XML/1998/namespace". * Returns: a new Element object with the following attributes: * %Node.nodeName = @qualifiedName, * %Node.namespaceURI = @namespaceURI, * %Node.prefix = prefix, extracted from @qualifiedName, * %Node.localName = localName, extracted from @qualifiedName, * %Element.tagName = @qualifiedName. */ GdomeElement * gdome_doc_createElementNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->createElementNS (self, namespaceURI, qualifiedName, exc); } /** * gdome_doc_createEntityReference: * @self: Document Object ref * @name: The name of the entity to reference * @exc: Exception Object ref * * Creates an EntityReference object. In addition, if the referenced entity is * known, the child list of the EntityReference node is made the same as that * of the corresponding Entity node. * Returns: the new EntityReference object. */ GdomeEntityReference * gdome_doc_createEntityReference (GdomeDocument *self, GdomeDOMString *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->createEntityReference (self, name, exc); } /** * gdome_doc_createProcessingInstruction: * @self: Document Object ref * @target: The target part of the processing instruction * @data: The data for the node * @exc: Exception Object ref * * Creates a ProcessingInstruction node given the specified name and data * strings. * Returns: The new ProcessingInstruction object. */ GdomeProcessingInstruction * gdome_doc_createProcessingInstruction (GdomeDocument *self, GdomeDOMString *target, GdomeDOMString *data, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->createProcessingInstruction (self, target, data, exc); } /** * gdome_doc_createTextNode: * @self: Document Object ref * @data: The data for the node * @exc: Exception Object ref * * Creates a Text node given the specified string. * Returns: The new TextNode object. */ GdomeText * gdome_doc_createTextNode (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->createTextNode (self, data, exc); } /** * gdome_doc_getElementById: * @self: Document Object ref * @elementId: The unique id value for an element * @exc: Exception Object ref * * Returns: the Element whose %ID is given by @elementId. If no such element * exists, returns %NULL. Behavior is not defined if more than one element has * this %ID. */ GdomeElement * gdome_doc_getElementById (GdomeDocument *self, GdomeDOMString *elementId, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->getElementById (self, elementId, exc); } /** * gdome_doc_getElementsByTagName: * @self: Document Object ref * @tagName: The name of the tag to match on. The special value * matches * all tags. * @exc: Exception Object ref * * Returns: a NodeList of all the elements with a given tag name in the order * in which they are encountered in a preorder traversal of the Document tree. */ GdomeNodeList * gdome_doc_getElementsByTagName (GdomeDocument *self, GdomeDOMString *tagname, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->getElementsByTagName (self, tagname, exc); } /** * gdome_doc_getElementsByTagNameNS: * @self: Document Objects ref * @namespaceURI: The namespace URI of the elements to match on. The special * value * matches all namespaces. * @localName: The local name of the elements to match on. The special value * * matches all local names. * @exc: Document Object ref * * Returns: a NodeList of all the descendant elements with a given local name * and namespace URI in the order in which they are encountered in a preorder * traversal of this Document tree. */ GdomeNodeList * gdome_doc_getElementsByTagNameNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->getElementsByTagNameNS (self, namespaceURI, localName, exc); } /** * gdome_doc_importNode: * @self: Document Objects ref * @importedNode: The node to import. * @deep: If %TRUE, recursively import the subtree under the specified node; * if %FALSE, import only the node itself. This has no effect on Attr, * EntityReference, and Notation nodes. * @exc: Exception Object ref * * * Imports a node from another document to this document. The returned node has * no parent; (parentNode is %NULL). The source node is not altered or removed * from the original document; this method creates a new copy of the source * node. %GDOME_DOCUMENT_NODE, %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE * and %GDOME_ENTITY_NODE nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being imported is not * supported. * Returns: the imported node that belongs to this Document. */ GdomeNode * gdome_doc_importNode (GdomeDocument *self, GdomeNode *importedNode, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->importNode (self, importedNode, deep, exc); } /** * gdome_doc_createEvent: * @self: Document Objects ref * @eventType: The @eventType parameter specifies the type of Event interface * to be created. * @exc: Exception Object ref * * If the Event interface specified is supported by the implementation this * method will return a new Event of the interface type requested. If the Event * is to be dispatched via the dispatchEvent method the appropriate event init * method must be called after creation in order to initialize the Event's * values. As an example, a user wishing to synthesize some kind of * MutationEvents would call createEvent with the parameter "MutationEvents". * The gdome_mevnt_initMuatationEvent() method could then be called on the * newly created MutationEvent to set the specific type of MutationEvent to be * dispatched and set its context information. * * GDOME_NOT_SUPPORTED_ERR: Raised if the implementation does not support the * type of Event interface requested * Returns: the newly created Event. */ GdomeEvent * gdome_doc_createEvent (GdomeDocument *self, GdomeDOMString *eventType, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Document *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->createEvent (self, eventType, exc); } /** * gdome_doc_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_doc_attributes (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.attributes ((GdomeNode *)self, exc); } /** * gdome_doc_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_doc_childNodes (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.childNodes ((GdomeNode *)self, exc); } /** * gdome_doc_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_doc_firstChild (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.firstChild ((GdomeNode *)self, exc); } /** * gdome_doc_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_doc_lastChild (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.lastChild ((GdomeNode *)self, exc); } /** * gdome_doc_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_doc_localName (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.localName ((GdomeNode *)self, exc); } /** * gdome_doc_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_doc_namespaceURI (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_doc_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_doc_nextSibling (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_doc_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_doc_nodeName (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.nodeName ((GdomeNode *)self, exc); } /** * gdome_doc_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_doc_nodeType (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.nodeType ((GdomeNode *)self, exc); } /** * gdome_doc_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_doc_nodeValue (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_doc_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_doc_set_nodeValue (GdomeDocument *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Document *)self)->vtab->super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_doc_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_doc_ownerDocument (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_doc_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_doc_parentNode (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.parentNode ((GdomeNode *)self, exc); } /** * gdome_doc_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_doc_prefix (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.prefix ((GdomeNode *)self, exc); } /** * gdome_doc_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_doc_set_prefix (GdomeDocument *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Document *)self)->vtab->super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_doc_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_doc_previousSibling (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_doc_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_doc_ref (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Document *)self)->vtab->super.ref ((GdomeNode *)self, exc); } /** * gdome_doc_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_doc_unref (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_Document *)self)->vtab->super.unref ((GdomeNode *)self, exc); } /** * gdome_doc_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_doc_query_interface (GdomeDocument *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_doc_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_doc_appendChild (GdomeDocument *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_doc_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_doc_cloneNode (GdomeDocument *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_doc_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_doc_hasAttributes (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_doc_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_doc_hasChildNodes (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_doc_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_doc_insertBefore (GdomeDocument *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_doc_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_doc_isSupported (GdomeDocument *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_doc_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_doc_normalize (GdomeDocument *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Document *)self)->vtab->super.normalize ((GdomeNode *)self, exc); } /** * gdome_doc_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_doc_removeChild (GdomeDocument *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_doc_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_doc_replaceChild (GdomeDocument *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_doc_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_doc_addEventListener (GdomeDocument *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Document *)self)->vtab->super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_doc_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_doc_removeEventListener (GdomeDocument *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Document *)self)->vtab->super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_doc_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_doc_dispatchEvent (GdomeDocument *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_doc_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_doc_subTreeDispatchEvent (GdomeDocument *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Document *)self)->vtab->super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_doc_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_doc_canAppend (GdomeDocument *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Document *)self)->vtab->super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeCharacterData interface API ******************************************************************************/ /** * gdome_cd_data: * @self: The CharacterData Object ref * @exc: The Exception Object ref * * Returns: the character data of the node that implements this interface. */ GdomeDOMString * gdome_cd_data (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->data (self, exc); } /** * gdome_cd_set_data: * @self: The CharacterData Object ref * @data: The data value for this node * @exc: The Exception Object ref * * Sets the data value of this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cd_set_data (GdomeCharacterData *self, GdomeDOMString *data, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->set_data (self, data, exc); } /** * gdome_cd_length: * @self: The CharacterData Object ref * @exc: The GdomeException Object ref * * Returns: The number of 16-bit units that are available. This may have the * value zero, i.e., CharacterData nodes may be empty. */ gulong gdome_cd_length (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0L; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0L; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->length (self, exc); } /** * gdome_cd_appendData: * @self: The CharacterData Object ref * @arg: The string to append * @exc: The Exception Object ref * * Append the string to the end of the character data of the node. Upon * success, data provides access to the concatenation of data and the * string specified. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cd_appendData (GdomeCharacterData *self, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->appendData (self, arg, exc); } /** * gdome_cd_deleteData: * @self: The CharacterData Object ref * @offset: The offset from which to start removing * @count: The number of 16-bit units to delete. * @exc: The Exception Object ref * * Remove a range of 16-bit units from the node. If the sum of @offset and * @count exceeds length then all 16-bit units from @offset to the end of the * data are deleted. Upon success, data and length reflect the change. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cd_deleteData (GdomeCharacterData *self, gulong offset, gulong count, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->deleteData (self, offset, count, exc); } /** * gdome_cd_insertData: * @self: The CharacterData Object ref * @offset: The character offset at which to insert * @arg: The string to insert * @exc: The Exception Object ref * * Insert a string at the specified 16-bit unit offset. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cd_insertData (GdomeCharacterData *self, gulong offset, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->insertData (self, offset, arg, exc); } /** * gdome_cd_replaceData: * @self: The CharacterData Object ref * @offset: The offset from which to start replacing * @count: The number of 16-bit units to replace. * @arg: The String with which the range must be replaced * @exc: The GdomeException Object ref * * Replace the characters starting at the specified 16-bit unit @offset with * the specified string. If the sum of @offset and @count exceeds length, then * all 16-bit units to the end of the data are replaced; * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cd_replaceData (GdomeCharacterData *self, gulong offset, gulong count, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->replaceData (self, offset, count, arg, exc); } /** * gdome_cd_substringData: * @self: The CharacterData Object ref * @offset: Start offset of substring to extract * @count: The number of 16-bit units to extract * @exc: The Exception Object ref * * Extracts a range of data from the node. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * Returns: The specified substring. If the sum of @offset and @count exceeds * the length, then all 16-bit units to the end of the data are returned. */ GdomeDOMString * gdome_cd_substringData (GdomeCharacterData *self, gulong offset, gulong count, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->substringData (self, offset, count, exc); } /** * gdome_cd_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_cd_attributes (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.attributes ((GdomeNode *)self, exc); } /** * gdome_cd_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_cd_childNodes (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.childNodes ((GdomeNode *)self, exc); } /** * gdome_cd_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_cd_firstChild (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.firstChild ((GdomeNode *)self, exc); } /** * gdome_cd_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_cd_lastChild (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.lastChild ((GdomeNode *)self, exc); } /** * gdome_cd_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_cd_localName (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.localName ((GdomeNode *)self, exc); } /** * gdome_cd_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_cd_namespaceURI (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_cd_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_cd_nextSibling (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_cd_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_cd_nodeName (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.nodeName ((GdomeNode *)self, exc); } /** * gdome_cd_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_cd_nodeType (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.nodeType ((GdomeNode *)self, exc); } /** * gdome_cd_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_cd_nodeValue (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_cd_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cd_set_nodeValue (GdomeCharacterData *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_cd_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_cd_ownerDocument (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_cd_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_cd_parentNode (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.parentNode ((GdomeNode *)self, exc); } /** * gdome_cd_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_cd_prefix (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.prefix ((GdomeNode *)self, exc); } /** * gdome_cd_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_cd_set_prefix (GdomeCharacterData *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_cd_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_cd_previousSibling (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_cd_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_cd_ref (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->super.ref ((GdomeNode *)self, exc); } /** * gdome_cd_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_cd_unref (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_CharacterData *)self)->vtab->super.unref ((GdomeNode *)self, exc); } /** * gdome_cd_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_cd_query_interface (GdomeCharacterData *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_cd_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_cd_appendChild (GdomeCharacterData *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_cd_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_cd_cloneNode (GdomeCharacterData *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_cd_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_cd_hasAttributes (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_cd_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_cd_hasChildNodes (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_cd_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_cd_insertBefore (GdomeCharacterData *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_cd_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_cd_isSupported (GdomeCharacterData *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_cd_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_cd_normalize (GdomeCharacterData *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->super.normalize ((GdomeNode *)self, exc); } /** * gdome_cd_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_cd_removeChild (GdomeCharacterData *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_cd_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_cd_replaceChild (GdomeCharacterData *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_cd_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_cd_addEventListener (GdomeCharacterData *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_cd_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_cd_removeEventListener (GdomeCharacterData *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_cd_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_cd_dispatchEvent (GdomeCharacterData *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_cd_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_cd_subTreeDispatchEvent (GdomeCharacterData *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CharacterData *)self)->vtab->super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_cd_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_cd_canAppend (GdomeCharacterData *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_CharacterData *)self)->vtab->super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeText interface API ******************************************************************************/ /** * gdome_t_splitText: * @self: The Text Object ref * @offset: The 16-bit unit offset at which to split, starting from 0 * @exc: The GdomeException Object ref * * Breaks this node into two nodes at the specified @offset, keeping both in * the tree as siblings. After being split, this node will contain all the * content up to the @offset point. A new node of the same type, which contains * all the content at and after the @offset point, is returned. If the original * node had a parent node, the new node is inserted as the next sibling of the * original node. When the @offset is equal to the length of this node, the new * node has no data. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * Returns: the new node, of the same type as this node. */ GdomeText * gdome_t_splitText (GdomeText *self, gulong offset, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Text *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->splitText (self, offset, exc); } /** * gdome_t_data: * @self: The CharacterData Object ref * @exc: The Exception Object ref * * Returns: the character data of the node that implements this interface. */ GdomeDOMString * gdome_t_data (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.data ((GdomeCharacterData *)self, exc); } /** * gdome_t_set_data: * @self: The CharacterData Object ref * @data: The data value for this node * @exc: The Exception Object ref * * Sets the data value of this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_t_set_data (GdomeText *self, GdomeDOMString *data, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.set_data ((GdomeCharacterData *)self, data, exc); } /** * gdome_t_length: * @self: The CharacterData Object ref * @exc: The GdomeException Object ref * * Returns: The number of 16-bit units that are available. This may have the * value zero, i.e., CharacterData nodes may be empty. */ gulong gdome_t_length (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0L; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0L; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.length ((GdomeCharacterData *)self, exc); } /** * gdome_t_appendData: * @self: The CharacterData Object ref * @arg: The string to append * @exc: The Exception Object ref * * Append the string to the end of the character data of the node. Upon * success, data provides access to the concatenation of data and the * string specified. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_t_appendData (GdomeText *self, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.appendData ((GdomeCharacterData *)self, arg, exc); } /** * gdome_t_deleteData: * @self: The CharacterData Object ref * @offset: The offset from which to start removing * @count: The number of 16-bit units to delete. * @exc: The Exception Object ref * * Remove a range of 16-bit units from the node. If the sum of @offset and * @count exceeds length then all 16-bit units from @offset to the end of the * data are deleted. Upon success, data and length reflect the change. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_t_deleteData (GdomeText *self, gulong offset, gulong count, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.deleteData ((GdomeCharacterData *)self, offset, count, exc); } /** * gdome_t_insertData: * @self: The CharacterData Object ref * @offset: The character offset at which to insert * @arg: The string to insert * @exc: The Exception Object ref * * Insert a string at the specified 16-bit unit offset. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_t_insertData (GdomeText *self, gulong offset, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.insertData ((GdomeCharacterData *)self, offset, arg, exc); } /** * gdome_t_replaceData: * @self: The CharacterData Object ref * @offset: The offset from which to start replacing * @count: The number of 16-bit units to replace. * @arg: The String with which the range must be replaced * @exc: The GdomeException Object ref * * Replace the characters starting at the specified 16-bit unit @offset with * the specified string. If the sum of @offset and @count exceeds length, then * all 16-bit units to the end of the data are replaced; * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_t_replaceData (GdomeText *self, gulong offset, gulong count, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.replaceData ((GdomeCharacterData *)self, offset, count, arg, exc); } /** * gdome_t_substringData: * @self: The CharacterData Object ref * @offset: Start offset of substring to extract * @count: The number of 16-bit units to extract * @exc: The Exception Object ref * * Extracts a range of data from the node. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * Returns: The specified substring. If the sum of @offset and @count exceeds * the length, then all 16-bit units to the end of the data are returned. */ GdomeDOMString * gdome_t_substringData (GdomeText *self, gulong offset, gulong count, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.substringData ((GdomeCharacterData *)self, offset, count, exc); } /** * gdome_t_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_t_attributes (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.attributes ((GdomeNode *)self, exc); } /** * gdome_t_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_t_childNodes (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.childNodes ((GdomeNode *)self, exc); } /** * gdome_t_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_t_firstChild (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.firstChild ((GdomeNode *)self, exc); } /** * gdome_t_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_t_lastChild (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.lastChild ((GdomeNode *)self, exc); } /** * gdome_t_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_t_localName (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.localName ((GdomeNode *)self, exc); } /** * gdome_t_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_t_namespaceURI (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_t_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_t_nextSibling (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_t_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_t_nodeName (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.nodeName ((GdomeNode *)self, exc); } /** * gdome_t_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_t_nodeType (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.nodeType ((GdomeNode *)self, exc); } /** * gdome_t_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_t_nodeValue (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_t_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_t_set_nodeValue (GdomeText *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_t_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_t_ownerDocument (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_t_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_t_parentNode (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.parentNode ((GdomeNode *)self, exc); } /** * gdome_t_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_t_prefix (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.prefix ((GdomeNode *)self, exc); } /** * gdome_t_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_t_set_prefix (GdomeText *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_t_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_t_previousSibling (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_t_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_t_ref (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.super.ref ((GdomeNode *)self, exc); } /** * gdome_t_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_t_unref (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_Text *)self)->vtab->super.super.unref ((GdomeNode *)self, exc); } /** * gdome_t_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_t_query_interface (GdomeText *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_t_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_t_appendChild (GdomeText *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_t_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_t_cloneNode (GdomeText *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_t_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_t_hasAttributes (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_t_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_t_hasChildNodes (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_t_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_t_insertBefore (GdomeText *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_t_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_t_isSupported (GdomeText *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_t_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_t_normalize (GdomeText *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.super.normalize ((GdomeNode *)self, exc); } /** * gdome_t_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_t_removeChild (GdomeText *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_t_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_t_replaceChild (GdomeText *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_t_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_t_addEventListener (GdomeText *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_t_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_t_removeEventListener (GdomeText *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_t_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_t_dispatchEvent (GdomeText *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_t_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_t_subTreeDispatchEvent (GdomeText *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Text *)self)->vtab->super.super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_t_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_t_canAppend (GdomeText *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Text *)self)->vtab->super.super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeCDATASection interface API ******************************************************************************/ /** * gdome_cds_splitText: * @self: The Text Object ref * @offset: The 16-bit unit offset at which to split, starting from 0 * @exc: The GdomeException Object ref * * Breaks this node into two nodes at the specified @offset, keeping both in * the tree as siblings. After being split, this node will contain all the * content up to the @offset point. A new node of the same type, which contains * all the content at and after the @offset point, is returned. If the original * node had a parent node, the new node is inserted as the next sibling of the * original node. When the @offset is equal to the length of this node, the new * node has no data. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * Returns: the new node, of the same type as this node. */ GdomeText * gdome_cds_splitText (GdomeCDATASection *self, gulong offset, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Text *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.splitText ((GdomeText *)self, offset, exc); } /** * gdome_cds_data: * @self: The CharacterData Object ref * @exc: The Exception Object ref * * Returns: the character data of the node that implements this interface. */ GdomeDOMString * gdome_cds_data (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.data ((GdomeCharacterData *)self, exc); } /** * gdome_cds_set_data: * @self: The CharacterData Object ref * @data: The data value for this node * @exc: The Exception Object ref * * Sets the data value of this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cds_set_data (GdomeCDATASection *self, GdomeDOMString *data, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.set_data ((GdomeCharacterData *)self, data, exc); } /** * gdome_cds_length: * @self: The CharacterData Object ref * @exc: The GdomeException Object ref * * Returns: The number of 16-bit units that are available. This may have the * value zero, i.e., CharacterData nodes may be empty. */ gulong gdome_cds_length (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0L; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0L; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.length ((GdomeCharacterData *)self, exc); } /** * gdome_cds_appendData: * @self: The CharacterData Object ref * @arg: The string to append * @exc: The Exception Object ref * * Append the string to the end of the character data of the node. Upon * success, data provides access to the concatenation of data and the * string specified. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cds_appendData (GdomeCDATASection *self, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.appendData ((GdomeCharacterData *)self, arg, exc); } /** * gdome_cds_deleteData: * @self: The CharacterData Object ref * @offset: The offset from which to start removing * @count: The number of 16-bit units to delete. * @exc: The Exception Object ref * * Remove a range of 16-bit units from the node. If the sum of @offset and * @count exceeds length then all 16-bit units from @offset to the end of the * data are deleted. Upon success, data and length reflect the change. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cds_deleteData (GdomeCDATASection *self, gulong offset, gulong count, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.deleteData ((GdomeCharacterData *)self, offset, count, exc); } /** * gdome_cds_insertData: * @self: The CharacterData Object ref * @offset: The character offset at which to insert * @arg: The string to insert * @exc: The Exception Object ref * * Insert a string at the specified 16-bit unit offset. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cds_insertData (GdomeCDATASection *self, gulong offset, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.insertData ((GdomeCharacterData *)self, offset, arg, exc); } /** * gdome_cds_replaceData: * @self: The CharacterData Object ref * @offset: The offset from which to start replacing * @count: The number of 16-bit units to replace. * @arg: The String with which the range must be replaced * @exc: The GdomeException Object ref * * Replace the characters starting at the specified 16-bit unit @offset with * the specified string. If the sum of @offset and @count exceeds length, then * all 16-bit units to the end of the data are replaced; * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cds_replaceData (GdomeCDATASection *self, gulong offset, gulong count, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.replaceData ((GdomeCharacterData *)self, offset, count, arg, exc); } /** * gdome_cds_substringData: * @self: The CharacterData Object ref * @offset: Start offset of substring to extract * @count: The number of 16-bit units to extract * @exc: The Exception Object ref * * Extracts a range of data from the node. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * Returns: The specified substring. If the sum of @offset and @count exceeds * the length, then all 16-bit units to the end of the data are returned. */ GdomeDOMString * gdome_cds_substringData (GdomeCDATASection *self, gulong offset, gulong count, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.substringData ((GdomeCharacterData *)self, offset, count, exc); } /** * gdome_cds_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_cds_attributes (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.attributes ((GdomeNode *)self, exc); } /** * gdome_cds_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_cds_childNodes (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.childNodes ((GdomeNode *)self, exc); } /** * gdome_cds_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_cds_firstChild (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.firstChild ((GdomeNode *)self, exc); } /** * gdome_cds_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_cds_lastChild (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.lastChild ((GdomeNode *)self, exc); } /** * gdome_cds_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_cds_localName (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.localName ((GdomeNode *)self, exc); } /** * gdome_cds_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_cds_namespaceURI (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_cds_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_cds_nextSibling (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_cds_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_cds_nodeName (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.nodeName ((GdomeNode *)self, exc); } /** * gdome_cds_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_cds_nodeType (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.nodeType ((GdomeNode *)self, exc); } /** * gdome_cds_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_cds_nodeValue (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_cds_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_cds_set_nodeValue (GdomeCDATASection *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_cds_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_cds_ownerDocument (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_cds_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_cds_parentNode (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.parentNode ((GdomeNode *)self, exc); } /** * gdome_cds_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_cds_prefix (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.prefix ((GdomeNode *)self, exc); } /** * gdome_cds_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_cds_set_prefix (GdomeCDATASection *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_cds_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_cds_previousSibling (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_cds_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_cds_ref (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.ref ((GdomeNode *)self, exc); } /** * gdome_cds_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_cds_unref (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.unref ((GdomeNode *)self, exc); } /** * gdome_cds_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_cds_query_interface (GdomeCDATASection *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_cds_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_cds_appendChild (GdomeCDATASection *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_cds_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_cds_cloneNode (GdomeCDATASection *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_cds_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_cds_hasAttributes (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_cds_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_cds_hasChildNodes (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_cds_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_cds_insertBefore (GdomeCDATASection *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_cds_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_cds_isSupported (GdomeCDATASection *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_cds_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_cds_normalize (GdomeCDATASection *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.normalize ((GdomeNode *)self, exc); } /** * gdome_cds_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_cds_removeChild (GdomeCDATASection *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_cds_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_cds_replaceChild (GdomeCDATASection *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_cds_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_cds_addEventListener (GdomeCDATASection *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_cds_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_cds_removeEventListener (GdomeCDATASection *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_cds_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_cds_dispatchEvent (GdomeCDATASection *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_cds_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_cds_subTreeDispatchEvent (GdomeCDATASection *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_cds_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_cds_canAppend (GdomeCDATASection *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_CDATASection *)self)->vtab->super.super.super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeComment interface API ******************************************************************************/ /** * gdome_c_data: * @self: The CharacterData Object ref * @exc: The Exception Object ref * * Returns: the character data of the node that implements this interface. */ GdomeDOMString * gdome_c_data (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.data ((GdomeCharacterData *)self, exc); } /** * gdome_c_set_data: * @self: The CharacterData Object ref * @data: The data value for this node * @exc: The Exception Object ref * * Sets the data value of this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_c_set_data (GdomeComment *self, GdomeDOMString *data, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.set_data ((GdomeCharacterData *)self, data, exc); } /** * gdome_c_length: * @self: The CharacterData Object ref * @exc: The GdomeException Object ref * * Returns: The number of 16-bit units that are available. This may have the * value zero, i.e., CharacterData nodes may be empty. */ gulong gdome_c_length (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0L; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0L; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.length ((GdomeCharacterData *)self, exc); } /** * gdome_c_appendData: * @self: The CharacterData Object ref * @arg: The string to append * @exc: The Exception Object ref * * Append the string to the end of the character data of the node. Upon * success, data provides access to the concatenation of data and the * string specified. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_c_appendData (GdomeComment *self, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.appendData ((GdomeCharacterData *)self, arg, exc); } /** * gdome_c_deleteData: * @self: The CharacterData Object ref * @offset: The offset from which to start removing * @count: The number of 16-bit units to delete. * @exc: The Exception Object ref * * Remove a range of 16-bit units from the node. If the sum of @offset and * @count exceeds length then all 16-bit units from @offset to the end of the * data are deleted. Upon success, data and length reflect the change. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_c_deleteData (GdomeComment *self, gulong offset, gulong count, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.deleteData ((GdomeCharacterData *)self, offset, count, exc); } /** * gdome_c_insertData: * @self: The CharacterData Object ref * @offset: The character offset at which to insert * @arg: The string to insert * @exc: The Exception Object ref * * Insert a string at the specified 16-bit unit offset. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_c_insertData (GdomeComment *self, gulong offset, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.insertData ((GdomeCharacterData *)self, offset, arg, exc); } /** * gdome_c_replaceData: * @self: The CharacterData Object ref * @offset: The offset from which to start replacing * @count: The number of 16-bit units to replace. * @arg: The String with which the range must be replaced * @exc: The GdomeException Object ref * * Replace the characters starting at the specified 16-bit unit @offset with * the specified string. If the sum of @offset and @count exceeds length, then * all 16-bit units to the end of the data are replaced; * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_c_replaceData (GdomeComment *self, gulong offset, gulong count, GdomeDOMString *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.replaceData ((GdomeCharacterData *)self, offset, count, arg, exc); } /** * gdome_c_substringData: * @self: The CharacterData Object ref * @offset: Start offset of substring to extract * @count: The number of 16-bit units to extract * @exc: The Exception Object ref * * Extracts a range of data from the node. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * Returns: The specified substring. If the sum of @offset and @count exceeds * the length, then all 16-bit units to the end of the data are returned. */ GdomeDOMString * gdome_c_substringData (GdomeComment *self, gulong offset, gulong count, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_CharacterData *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.substringData ((GdomeCharacterData *)self, offset, count, exc); } /** * gdome_c_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_c_attributes (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.attributes ((GdomeNode *)self, exc); } /** * gdome_c_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_c_childNodes (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.childNodes ((GdomeNode *)self, exc); } /** * gdome_c_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_c_firstChild (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.firstChild ((GdomeNode *)self, exc); } /** * gdome_c_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_c_lastChild (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.lastChild ((GdomeNode *)self, exc); } /** * gdome_c_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_c_localName (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.localName ((GdomeNode *)self, exc); } /** * gdome_c_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_c_namespaceURI (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_c_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_c_nextSibling (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_c_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_c_nodeName (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.nodeName ((GdomeNode *)self, exc); } /** * gdome_c_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_c_nodeType (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.nodeType ((GdomeNode *)self, exc); } /** * gdome_c_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_c_nodeValue (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_c_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_c_set_nodeValue (GdomeComment *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_c_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_c_ownerDocument (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_c_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_c_parentNode (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.parentNode ((GdomeNode *)self, exc); } /** * gdome_c_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_c_prefix (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.prefix ((GdomeNode *)self, exc); } /** * gdome_c_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_c_set_prefix (GdomeComment *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_c_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_c_previousSibling (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_c_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_c_ref (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.super.ref ((GdomeNode *)self, exc); } /** * gdome_c_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_c_unref (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_Comment *)self)->vtab->super.super.unref ((GdomeNode *)self, exc); } /** * gdome_c_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_c_query_interface (GdomeComment *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_c_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_c_appendChild (GdomeComment *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_c_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_c_cloneNode (GdomeComment *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_c_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_c_hasAttributes (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_c_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_c_hasChildNodes (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_c_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_c_insertBefore (GdomeComment *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_c_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_c_isSupported (GdomeComment *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_c_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_c_normalize (GdomeComment *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.super.normalize ((GdomeNode *)self, exc); } /** * gdome_c_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_c_removeChild (GdomeComment *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_c_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_c_replaceChild (GdomeComment *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_c_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_c_addEventListener (GdomeComment *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_c_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_c_removeEventListener (GdomeComment *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_c_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_c_dispatchEvent (GdomeComment *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_c_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_c_subTreeDispatchEvent (GdomeComment *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Comment *)self)->vtab->super.super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_c_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_c_canAppend (GdomeComment *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Comment *)self)->vtab->super.super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeAttr interface API ******************************************************************************/ /** * gdome_a_name: * @self: Attr Object ref * @exc: Exception Object ref * * Returns: the qualified name of this attribute. */ GdomeDOMString * gdome_a_name (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Attr *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->name (self, exc); } /** * gdome_a_ownerElement: * @self: Attr Object ref * @exc: Exception Object ref * * Returns: the Element node this attribute is attached to or %NULL if this * attribute is not in use. */ GdomeElement * gdome_a_ownerElement (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Attr *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->ownerElement (self, exc); } /** * gdome_a_specified: * @self: Attr Object ref * @exc: Exception Object ref * * NOT IMPLEMENTED * Returns: %TRUE */ GdomeBoolean gdome_a_specified (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Attr *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->specified (self, exc); } /** * gdome_a_value: * @self: Attr Object ref * @exc: Exception Object ref * * Returns: the value of this attribute. */ GdomeDOMString * gdome_a_value (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Attr *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->value (self, exc); } /** * gdome_a_set_value: * @self: Attr Object ref * @value: The new value to set * @exc: Exception Object ref * * Sets the value of this attribute. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_a_set_value (GdomeAttr *self, GdomeDOMString *value, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Attr *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Attr *)self)->vtab->set_value (self, value, exc); } /** * gdome_a_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_a_attributes (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.attributes ((GdomeNode *)self, exc); } /** * gdome_a_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_a_childNodes (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.childNodes ((GdomeNode *)self, exc); } /** * gdome_a_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_a_firstChild (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.firstChild ((GdomeNode *)self, exc); } /** * gdome_a_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_a_lastChild (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.lastChild ((GdomeNode *)self, exc); } /** * gdome_a_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_a_localName (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.localName ((GdomeNode *)self, exc); } /** * gdome_a_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_a_namespaceURI (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_a_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_a_nextSibling (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_a_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_a_nodeName (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.nodeName ((GdomeNode *)self, exc); } /** * gdome_a_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_a_nodeType (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.nodeType ((GdomeNode *)self, exc); } /** * gdome_a_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_a_nodeValue (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_a_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_a_set_nodeValue (GdomeAttr *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Attr *)self)->vtab->super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_a_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_a_ownerDocument (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_a_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_a_parentNode (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.parentNode ((GdomeNode *)self, exc); } /** * gdome_a_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_a_prefix (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.prefix ((GdomeNode *)self, exc); } /** * gdome_a_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_a_set_prefix (GdomeAttr *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Attr *)self)->vtab->super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_a_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_a_previousSibling (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_a_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_a_ref (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Attr *)self)->vtab->super.ref ((GdomeNode *)self, exc); } /** * gdome_a_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_a_unref (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_Attr *)self)->vtab->super.unref ((GdomeNode *)self, exc); } /** * gdome_a_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_a_query_interface (GdomeAttr *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_a_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_a_appendChild (GdomeAttr *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_a_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_a_cloneNode (GdomeAttr *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_a_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_a_hasAttributes (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_a_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_a_hasChildNodes (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_a_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_a_insertBefore (GdomeAttr *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_a_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_a_isSupported (GdomeAttr *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_a_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_a_normalize (GdomeAttr *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Attr *)self)->vtab->super.normalize ((GdomeNode *)self, exc); } /** * gdome_a_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_a_removeChild (GdomeAttr *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_a_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_a_replaceChild (GdomeAttr *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_a_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_a_addEventListener (GdomeAttr *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Attr *)self)->vtab->super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_a_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_a_removeEventListener (GdomeAttr *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Attr *)self)->vtab->super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_a_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_a_dispatchEvent (GdomeAttr *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_a_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_a_subTreeDispatchEvent (GdomeAttr *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Attr *)self)->vtab->super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_a_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_a_canAppend (GdomeAttr *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Attr *)self)->vtab->super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeElement interface API ******************************************************************************/ /** * gdome_el_tagName: * @self: Element Objects ref * @exc: Exception Object ref * * Returns: the qualified name of the element. */ GdomeDOMString * gdome_el_tagName (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->tagName (self, exc); } /** * gdome_el_getAttribute: * @self: Element Objects ref * @name: The name of attribute of which the value is wanted * @exc: Exception Object ref * * Retrieves an attribute value by name. * Returns: the Attr value as a string, or the empty string if that attribute * does not have a specified or default value. */ GdomeDOMString * gdome_el_getAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->getAttribute (self, name, exc); } /** * gdome_el_getAttributeNS: * @self: Element Objects ref * @namespaceURI: The namespaceURI of attribute to retrieve * @localName: The localName of the attribute to retrieve * @exc: Exception Object ref * * Retrieves an attribute value by local name and namespace URI. * Returns: the Attr value as a string, or the empty string if that attribute * does not have a specified or default value. */ GdomeDOMString * gdome_el_getAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->getAttributeNS (self, namespaceURI, localName, exc); } /** * gdome_el_getAttributeNode: * @self: Element Objects ref * @name: The name of the attribute to retreive * @exc: Exception Object ref * * Retrieves an attribute node by name. * To retrieve an attribute node by qualified name and namespace URI, use the * gdome_el_getAttributeNodeNS() method. * Returns: the Attr node with the specified @name or %NULL if there is no such * attribute. */ GdomeAttr * gdome_el_getAttributeNode (GdomeElement *self, GdomeDOMString *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->getAttributeNode (self, name, exc); } /** * gdome_el_getAttributeNodeNS: * @self: Element Objects ref * @namespaceURI: The namespace URI of the attribute to retrieve. * @localName: The local name of the attribute to retrieve. * @exc: Exception Object ref * * Retrieves an Attr node by local name and namespace URI. * Returns: the Attr node with the specified attribute local name and * namespace URI or %NULL if there is no such attribute. */ GdomeAttr * gdome_el_getAttributeNodeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->getAttributeNodeNS (self, namespaceURI, localName, exc); } /** * gdome_el_getElementsByTagName: * @self: Element Objects ref * @name: The name of the tag to match on. The special value * matches all * tags. * @exc: Exception Object ref * * Returns: a NodeList of all descendant elements with a given tag name, in the * order in which they are encountered in a preorder traversal of this Element * tree. */ GdomeNodeList * gdome_el_getElementsByTagName (GdomeElement *self, GdomeDOMString *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->getElementsByTagName (self, name, exc); } /** * gdome_el_getElementsByTagNameNS: * @self: Element Objects ref * @namespaceURI: The namespace URI of the elements to match on. The special * value * matches all namespaces. * @localName: The local name of the elements to match on. The special value * * matches all local names. * @exc: Exception Object ref * * Returns: a NodeList of all the descendant elements with a given local name * and namespace URI in the order in which they are encountered in a preorder * traversal of this Element tree. */ GdomeNodeList * gdome_el_getElementsByTagNameNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->getElementsByTagNameNS (self, namespaceURI, localName, exc); } /** * gdome_el_hasAttribute: * @self: Element Objects ref * @name: The name of the attribute to look for. * @exc: Exception Object ref * * Returns: %TRUE when an attribute with a given name is specified on this * element or has a default value, %FALSE otherwise. */ GdomeBoolean gdome_el_hasAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->hasAttribute (self, name, exc); } /** * gdome_el_hasAttributeNS: * @self: Element Objects ref * @namespaceURI: The namespaceURI of the attribute to look for. * @localName: The localName of the attribute to look for. * @exc: Exception Object ref * * Returns: %TRUE when an attribute with a given local name and namespace URI * is specified on this element or has a default value, %FALSE otherwise. */ GdomeBoolean gdome_el_hasAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->hasAttributeNS (self, namespaceURI, localName, exc); } /** * gdome_el_removeAttribute: * @self: Element Objects ref * @name: The name of the attribute to remove * @exc: Exception Object ref * * Removes an attribute by name. If the removed attribute is known to have a * default value, an attribute immediately appears containing the default * value as well as the corresponding namespace URI, local name, and prefix * when applicable. * To remove an attribute by local name and namespace URI, use the * gdome_el_removeAttributeNS() function. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. */ void gdome_el_removeAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Element *)self)->vtab->removeAttribute (self, name, exc); } /** * gdome_el_removeAttributeNS: * @self: Element Objects ref * @namespaceURI: The namespaceURI of attribute to remove * @localName: The localName of the attribute to remove * @exc: Exception Object ref * * Removes an attribute by local name and namespace URI. If the removed * attribute has a default value it is immediately replaced. The replacing * attribute has the same namespace URI and local name, as well as the * original prefix. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. */ void gdome_el_removeAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Element *)self)->vtab->removeAttributeNS (self, namespaceURI, localName, exc); } /** * gdome_el_removeAttributeNode: * @self: Element Objects ref * @oldAttr: The Attr node to remove from the attribute list * @exc: Exception Object ref * * Removes the specified attribute node. If the removed Attr has a default * value it is immediately replaced. The replacing attribute has the same * namespace URI and local name, as well as the original prefix, when * applicable. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * %GDOME_NOT_FOUND_ERR: Raised if @oldAttr is not an attribute of the element. * Returns: the Attr node that was removed. */ GdomeAttr * gdome_el_removeAttributeNode (GdomeElement *self, GdomeAttr *oldAttr, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->removeAttributeNode (self, oldAttr, exc); } /** * gdome_el_setAttribute: * @self: Element Objects ref * @name: The name of the attribute to create or alter * @value: Value to set in string form * @exc: Exception Object ref * * Adds a new attribute. If an attribute with that name is already present in * the element, its value is changed to be that of the value parameter. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. */ void gdome_el_setAttribute (GdomeElement *self, GdomeDOMString *name, GdomeDOMString *value, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Element *)self)->vtab->setAttribute (self, name, value, exc); } /** * gdome_el_setAttributeNS: * @self: Element Objects ref * @namespaceURI: The namespace URI of attribute to create or alter * @qualifiedName: The qualifiedName of the attribute to create or alter * @value: Value to set in string form * @exc: Exception Object ref * * Adds a new attribute. If an attribute with the same @namespaceURI and * localName is already present in the element, its value is changed to be * that of the value parameter. * * %GDOME_NAMESPACE_ERR: Raised if the @qualifiedName is malformed, if the * @qualifiedName has a prefix and the @namespaceURI is %NULL, if the * @qualifiedName has a prefix that is "xml" and the @namespaceURI is different * from "http://www.w3.org/XML/1998/namespace", or if the @qualifiedName is * "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/". * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. */ void gdome_el_setAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeDOMString *value, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Element *)self)->vtab->setAttributeNS (self, namespaceURI, qualifiedName, value, exc); } /** * gdome_el_setAttributeNode: * @self: Element Object ref * @newAttr: The Attr node to add to the attribute list * @exc: Exception Object ref * * Adds a new attribute node. If an attribute with that name is already present * in the element, it is replaced by the new one. * To add a new attribute node with a qualified name and namespace URI, use the * gdome_el_setAttributeNodeNS() method. * * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newAttr was created from a different * document than the one that created the element. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * %GDOME_INUSE_ATTRIBUTE_ERR: Raised if @newAttr is already an attribute of * another Element object. The DOM user must explicitly clone Attr nodes to * re-use them in other elements. * Returns: if the @newAttr attribute replaces an existing attribute, the * replaced Attr node is returned, otherwise %NULL is returned. */ GdomeAttr * gdome_el_setAttributeNode (GdomeElement *self, GdomeAttr *newAttr, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->setAttributeNode (self, newAttr, exc); } /** * gdome_el_setAttributeNodeNS: * @self: Element Object ref * @newAttr: The Attr node to add to the attribute list * @exc: Exception Object ref * * Adds a new attribute. If an attribute with that local name and that * namespace URI is already present in the element, it is replaced by the new * one. * * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newAttr was created from a different * document than the one that created the element. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * %GDOME_INUSE_ATTRIBUTE_ERR: Raised if @newAttr is already an attribute of * another Element object. The DOM user must explicitly clone Attr nodes to * re-use them in other elements. * Returns: if the @newAttr attribute replaces an existing attribute with the * same local name and namespace URI, the replaced Attr node is returned, * otherwise %NULL is returned. */ GdomeAttr * gdome_el_setAttributeNodeNS (GdomeElement *self, GdomeAttr *newAttr, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Element *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->setAttributeNodeNS (self, newAttr, exc); } /** * gdome_el_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_el_attributes (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.attributes ((GdomeNode *)self, exc); } /** * gdome_el_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_el_childNodes (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.childNodes ((GdomeNode *)self, exc); } /** * gdome_el_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_el_firstChild (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.firstChild ((GdomeNode *)self, exc); } /** * gdome_el_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_el_lastChild (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.lastChild ((GdomeNode *)self, exc); } /** * gdome_el_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_el_localName (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.localName ((GdomeNode *)self, exc); } /** * gdome_el_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_el_namespaceURI (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_el_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_el_nextSibling (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_el_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_el_nodeName (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.nodeName ((GdomeNode *)self, exc); } /** * gdome_el_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_el_nodeType (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.nodeType ((GdomeNode *)self, exc); } /** * gdome_el_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_el_nodeValue (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_el_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_el_set_nodeValue (GdomeElement *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Element *)self)->vtab->super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_el_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_el_ownerDocument (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_el_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_el_parentNode (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.parentNode ((GdomeNode *)self, exc); } /** * gdome_el_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_el_prefix (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.prefix ((GdomeNode *)self, exc); } /** * gdome_el_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_el_set_prefix (GdomeElement *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Element *)self)->vtab->super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_el_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_el_previousSibling (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_el_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_el_ref (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Element *)self)->vtab->super.ref ((GdomeNode *)self, exc); } /** * gdome_el_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_el_unref (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_Element *)self)->vtab->super.unref ((GdomeNode *)self, exc); } /** * gdome_el_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_el_query_interface (GdomeElement *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_el_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_el_appendChild (GdomeElement *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_el_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_el_cloneNode (GdomeElement *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_el_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_el_hasAttributes (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_el_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_el_hasChildNodes (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_el_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_el_insertBefore (GdomeElement *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_el_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_el_isSupported (GdomeElement *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_el_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_el_normalize (GdomeElement *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Element *)self)->vtab->super.normalize ((GdomeNode *)self, exc); } /** * gdome_el_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_el_removeChild (GdomeElement *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_el_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_el_replaceChild (GdomeElement *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_el_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_el_addEventListener (GdomeElement *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Element *)self)->vtab->super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_el_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_el_removeEventListener (GdomeElement *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Element *)self)->vtab->super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_el_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_el_dispatchEvent (GdomeElement *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_el_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_el_subTreeDispatchEvent (GdomeElement *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Element *)self)->vtab->super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_el_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_el_canAppend (GdomeElement *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Element *)self)->vtab->super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeDocumentType interface API ******************************************************************************/ /** * gdome_dt_entities: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the general entities, both external and * internal, declared in the DTD. Parameter entities are not contained. * Duplicates are discarded. */ GdomeNamedNodeMap * gdome_dt_entities (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_DocumentType *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->entities (self, exc); } /** * gdome_dt_internalSubset: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: The internal subset as a string, or %NULL if there is none or on * error. */ GdomeDOMString * gdome_dt_internalSubset (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_DocumentType *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->internalSubset (self, exc); } /** * gdome_dt_name: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: the name of DTD; i.e., the name immediately following the %DOCTYPE * keyword. */ GdomeDOMString * gdome_dt_name (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_DocumentType *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->name (self, exc); } /** * gdome_dt_notations: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the notations declared in the DTD. * Duplicates are discarded. Every node in this map also implements the * Notation interface. */ GdomeNamedNodeMap * gdome_dt_notations (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_DocumentType *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->notations (self, exc); } /** * gdome_dt_publicId: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: the public identifier of the external subset. */ GdomeDOMString * gdome_dt_publicId (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_DocumentType *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->publicId (self, exc); } /** * gdome_dt_systemId: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: the public identifier of the external subset. */ GdomeDOMString * gdome_dt_systemId (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_DocumentType *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->systemId (self, exc); } /** * gdome_dt_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_dt_attributes (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.attributes ((GdomeNode *)self, exc); } /** * gdome_dt_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_dt_childNodes (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.childNodes ((GdomeNode *)self, exc); } /** * gdome_dt_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_dt_firstChild (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.firstChild ((GdomeNode *)self, exc); } /** * gdome_dt_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_dt_lastChild (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.lastChild ((GdomeNode *)self, exc); } /** * gdome_dt_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_dt_localName (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.localName ((GdomeNode *)self, exc); } /** * gdome_dt_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_dt_namespaceURI (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_dt_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_dt_nextSibling (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_dt_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_dt_nodeName (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.nodeName ((GdomeNode *)self, exc); } /** * gdome_dt_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_dt_nodeType (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.nodeType ((GdomeNode *)self, exc); } /** * gdome_dt_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_dt_nodeValue (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_dt_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_dt_set_nodeValue (GdomeDocumentType *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentType *)self)->vtab->super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_dt_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_dt_ownerDocument (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_dt_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_dt_parentNode (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.parentNode ((GdomeNode *)self, exc); } /** * gdome_dt_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_dt_prefix (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.prefix ((GdomeNode *)self, exc); } /** * gdome_dt_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_dt_set_prefix (GdomeDocumentType *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentType *)self)->vtab->super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_dt_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_dt_previousSibling (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_dt_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_dt_ref (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentType *)self)->vtab->super.ref ((GdomeNode *)self, exc); } /** * gdome_dt_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_dt_unref (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_DocumentType *)self)->vtab->super.unref ((GdomeNode *)self, exc); } /** * gdome_dt_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_dt_query_interface (GdomeDocumentType *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_dt_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_dt_appendChild (GdomeDocumentType *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_dt_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_dt_cloneNode (GdomeDocumentType *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_dt_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_dt_hasAttributes (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_dt_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_dt_hasChildNodes (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_dt_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_dt_insertBefore (GdomeDocumentType *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_dt_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_dt_isSupported (GdomeDocumentType *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_dt_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_dt_normalize (GdomeDocumentType *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentType *)self)->vtab->super.normalize ((GdomeNode *)self, exc); } /** * gdome_dt_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_dt_removeChild (GdomeDocumentType *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_dt_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_dt_replaceChild (GdomeDocumentType *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_dt_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_dt_addEventListener (GdomeDocumentType *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentType *)self)->vtab->super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_dt_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_dt_removeEventListener (GdomeDocumentType *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentType *)self)->vtab->super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_dt_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_dt_dispatchEvent (GdomeDocumentType *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_dt_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_dt_subTreeDispatchEvent (GdomeDocumentType *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_DocumentType *)self)->vtab->super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_dt_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_dt_canAppend (GdomeDocumentType *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_DocumentType *)self)->vtab->super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeNotation interface API ******************************************************************************/ /** * gdome_not_publicId: * @self: Notations Object ref * @exc: Exception Object ref * * Returns: the public identifier of this notation. If the public identifier * was not specified, this is NULL. */ GdomeDOMString * gdome_not_publicId (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Notation *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->publicId (self, exc); } /** * gdome_not_systemId: * @self: Notations Object ref * @exc: Exception Object ref * * Returns: the system identifier of this notation. If the system identifier * was not specified, this is NULL. */ GdomeDOMString * gdome_not_systemId (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Notation *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->systemId (self, exc); } /** * gdome_not_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_not_attributes (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.attributes ((GdomeNode *)self, exc); } /** * gdome_not_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_not_childNodes (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.childNodes ((GdomeNode *)self, exc); } /** * gdome_not_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_not_firstChild (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.firstChild ((GdomeNode *)self, exc); } /** * gdome_not_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_not_lastChild (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.lastChild ((GdomeNode *)self, exc); } /** * gdome_not_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_not_localName (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.localName ((GdomeNode *)self, exc); } /** * gdome_not_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_not_namespaceURI (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_not_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_not_nextSibling (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_not_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_not_nodeName (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.nodeName ((GdomeNode *)self, exc); } /** * gdome_not_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_not_nodeType (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.nodeType ((GdomeNode *)self, exc); } /** * gdome_not_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_not_nodeValue (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_not_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_not_set_nodeValue (GdomeNotation *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Notation *)self)->vtab->super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_not_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_not_ownerDocument (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_not_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_not_parentNode (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.parentNode ((GdomeNode *)self, exc); } /** * gdome_not_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_not_prefix (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.prefix ((GdomeNode *)self, exc); } /** * gdome_not_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_not_set_prefix (GdomeNotation *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Notation *)self)->vtab->super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_not_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_not_previousSibling (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_not_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_not_ref (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Notation *)self)->vtab->super.ref ((GdomeNode *)self, exc); } /** * gdome_not_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_not_unref (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_Notation *)self)->vtab->super.unref ((GdomeNode *)self, exc); } /** * gdome_not_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_not_query_interface (GdomeNotation *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_not_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_not_appendChild (GdomeNotation *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_not_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_not_cloneNode (GdomeNotation *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_not_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_not_hasAttributes (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_not_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_not_hasChildNodes (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_not_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_not_insertBefore (GdomeNotation *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_not_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_not_isSupported (GdomeNotation *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_not_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_not_normalize (GdomeNotation *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Notation *)self)->vtab->super.normalize ((GdomeNode *)self, exc); } /** * gdome_not_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_not_removeChild (GdomeNotation *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_not_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_not_replaceChild (GdomeNotation *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_not_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_not_addEventListener (GdomeNotation *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Notation *)self)->vtab->super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_not_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_not_removeEventListener (GdomeNotation *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Notation *)self)->vtab->super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_not_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_not_dispatchEvent (GdomeNotation *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_not_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_not_subTreeDispatchEvent (GdomeNotation *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Notation *)self)->vtab->super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_not_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_not_canAppend (GdomeNotation *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Notation *)self)->vtab->super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeEntity interface API ******************************************************************************/ /** * gdome_ent_publicId: * @self: The Entity Object ref * @exc: The Exception Object ref * * Returns: the public identifier associated with the entity, if specified. * If the public identifier was not specified, this is %NULL. */ GdomeDOMString * gdome_ent_publicId (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Entity *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->publicId (self, exc); } /** * gdome_ent_systemId: * @self: The Entity Object ref * @exc: The Exception Object ref * * Returns: the system identifier associated with the entity, if specified. * If the system identifier was not specified, this is %NULL. */ GdomeDOMString * gdome_ent_systemId (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Entity *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->systemId (self, exc); } /** * gdome_ent_notationName: * @self: The Entity Object ref * @exc: The Exception Object ref * * Returns: for unparsed entities, the name of the notation for the entity. * For parsed entities, this is %NULL. */ GdomeDOMString * gdome_ent_notationName (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Entity *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->notationName (self, exc); } /** * gdome_ent_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_ent_attributes (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.attributes ((GdomeNode *)self, exc); } /** * gdome_ent_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_ent_childNodes (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.childNodes ((GdomeNode *)self, exc); } /** * gdome_ent_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_ent_firstChild (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.firstChild ((GdomeNode *)self, exc); } /** * gdome_ent_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_ent_lastChild (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.lastChild ((GdomeNode *)self, exc); } /** * gdome_ent_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_ent_localName (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.localName ((GdomeNode *)self, exc); } /** * gdome_ent_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_ent_namespaceURI (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_ent_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_ent_nextSibling (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_ent_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_ent_nodeName (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.nodeName ((GdomeNode *)self, exc); } /** * gdome_ent_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_ent_nodeType (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.nodeType ((GdomeNode *)self, exc); } /** * gdome_ent_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_ent_nodeValue (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_ent_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_ent_set_nodeValue (GdomeEntity *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Entity *)self)->vtab->super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_ent_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_ent_ownerDocument (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_ent_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_ent_parentNode (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.parentNode ((GdomeNode *)self, exc); } /** * gdome_ent_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_ent_prefix (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.prefix ((GdomeNode *)self, exc); } /** * gdome_ent_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_ent_set_prefix (GdomeEntity *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Entity *)self)->vtab->super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_ent_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_ent_previousSibling (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_ent_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_ent_ref (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Entity *)self)->vtab->super.ref ((GdomeNode *)self, exc); } /** * gdome_ent_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_ent_unref (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_Entity *)self)->vtab->super.unref ((GdomeNode *)self, exc); } /** * gdome_ent_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_ent_query_interface (GdomeEntity *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_ent_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_ent_appendChild (GdomeEntity *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_ent_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_ent_cloneNode (GdomeEntity *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_ent_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_ent_hasAttributes (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_ent_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_ent_hasChildNodes (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_ent_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_ent_insertBefore (GdomeEntity *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_ent_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_ent_isSupported (GdomeEntity *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_ent_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_ent_normalize (GdomeEntity *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Entity *)self)->vtab->super.normalize ((GdomeNode *)self, exc); } /** * gdome_ent_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_ent_removeChild (GdomeEntity *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_ent_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_ent_replaceChild (GdomeEntity *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_ent_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_ent_addEventListener (GdomeEntity *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Entity *)self)->vtab->super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_ent_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_ent_removeEventListener (GdomeEntity *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Entity *)self)->vtab->super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_ent_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_ent_dispatchEvent (GdomeEntity *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_ent_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_ent_subTreeDispatchEvent (GdomeEntity *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_Entity *)self)->vtab->super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_ent_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_ent_canAppend (GdomeEntity *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_Entity *)self)->vtab->super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeEntityReference interface API ******************************************************************************/ /** * gdome_er_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_er_attributes (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.attributes ((GdomeNode *)self, exc); } /** * gdome_er_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_er_childNodes (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.childNodes ((GdomeNode *)self, exc); } /** * gdome_er_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_er_firstChild (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.firstChild ((GdomeNode *)self, exc); } /** * gdome_er_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_er_lastChild (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.lastChild ((GdomeNode *)self, exc); } /** * gdome_er_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_er_localName (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.localName ((GdomeNode *)self, exc); } /** * gdome_er_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_er_namespaceURI (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_er_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_er_nextSibling (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_er_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_er_nodeName (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.nodeName ((GdomeNode *)self, exc); } /** * gdome_er_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_er_nodeType (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.nodeType ((GdomeNode *)self, exc); } /** * gdome_er_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_er_nodeValue (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_er_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_er_set_nodeValue (GdomeEntityReference *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_EntityReference *)self)->vtab->super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_er_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_er_ownerDocument (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_er_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_er_parentNode (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.parentNode ((GdomeNode *)self, exc); } /** * gdome_er_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_er_prefix (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.prefix ((GdomeNode *)self, exc); } /** * gdome_er_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_er_set_prefix (GdomeEntityReference *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_EntityReference *)self)->vtab->super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_er_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_er_previousSibling (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_er_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_er_ref (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_EntityReference *)self)->vtab->super.ref ((GdomeNode *)self, exc); } /** * gdome_er_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_er_unref (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_EntityReference *)self)->vtab->super.unref ((GdomeNode *)self, exc); } /** * gdome_er_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_er_query_interface (GdomeEntityReference *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_er_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_er_appendChild (GdomeEntityReference *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_er_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_er_cloneNode (GdomeEntityReference *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_er_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_er_hasAttributes (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_er_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_er_hasChildNodes (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_er_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_er_insertBefore (GdomeEntityReference *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_er_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_er_isSupported (GdomeEntityReference *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_er_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_er_normalize (GdomeEntityReference *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_EntityReference *)self)->vtab->super.normalize ((GdomeNode *)self, exc); } /** * gdome_er_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_er_removeChild (GdomeEntityReference *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_er_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_er_replaceChild (GdomeEntityReference *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_er_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_er_addEventListener (GdomeEntityReference *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_EntityReference *)self)->vtab->super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_er_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_er_removeEventListener (GdomeEntityReference *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_EntityReference *)self)->vtab->super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_er_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_er_dispatchEvent (GdomeEntityReference *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_er_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_er_subTreeDispatchEvent (GdomeEntityReference *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_EntityReference *)self)->vtab->super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_er_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_er_canAppend (GdomeEntityReference *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_EntityReference *)self)->vtab->super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeProcessingInstruction interface API ******************************************************************************/ /** * gdome_pi_data: * @self: ProcessingInstruction Object ref * @exc: Exception Object ref * * Returns: the content of this processing instruction. This is from the first * non white space character after the target to the character immediately * preceding the %?>. */ GdomeDOMString * gdome_pi_data (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_EntityReference *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->data (self, exc); } /** * gdome_pi_set_data: * @self: ProcessingInstruction Object ref * @data: The string of data to be set * @exc: Exception Object ref * * Set the content of this processing instruction. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_pi_set_data (GdomeProcessingInstruction *self, GdomeDOMString *data, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_EntityReference *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_ProcessingInstruction *)self)->vtab->set_data (self, data, exc); } /** * gdome_pi_target: * @self: ProcessingInstruction Object ref * @exc: Exception Object ref * * Returns: the target of this processing instruction. XML defines this as being * the first token following the markup that begins the processing instruction. */ GdomeDOMString * gdome_pi_target (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_EntityReference *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->target (self, exc); } /** * gdome_pi_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_pi_attributes (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.attributes ((GdomeNode *)self, exc); } /** * gdome_pi_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_pi_childNodes (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.childNodes ((GdomeNode *)self, exc); } /** * gdome_pi_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_pi_firstChild (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.firstChild ((GdomeNode *)self, exc); } /** * gdome_pi_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_pi_lastChild (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.lastChild ((GdomeNode *)self, exc); } /** * gdome_pi_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_pi_localName (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.localName ((GdomeNode *)self, exc); } /** * gdome_pi_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_pi_namespaceURI (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_pi_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_pi_nextSibling (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_pi_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_pi_nodeName (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.nodeName ((GdomeNode *)self, exc); } /** * gdome_pi_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_pi_nodeType (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.nodeType ((GdomeNode *)self, exc); } /** * gdome_pi_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_pi_nodeValue (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_pi_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_pi_set_nodeValue (GdomeProcessingInstruction *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_pi_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_pi_ownerDocument (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_pi_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_pi_parentNode (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.parentNode ((GdomeNode *)self, exc); } /** * gdome_pi_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_pi_prefix (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.prefix ((GdomeNode *)self, exc); } /** * gdome_pi_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_pi_set_prefix (GdomeProcessingInstruction *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_pi_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_pi_previousSibling (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_pi_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_pi_ref (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.ref ((GdomeNode *)self, exc); } /** * gdome_pi_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_pi_unref (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.unref ((GdomeNode *)self, exc); } /** * gdome_pi_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_pi_query_interface (GdomeProcessingInstruction *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_pi_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_pi_appendChild (GdomeProcessingInstruction *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_pi_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_pi_cloneNode (GdomeProcessingInstruction *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_pi_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_pi_hasAttributes (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_pi_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_pi_hasChildNodes (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_pi_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_pi_insertBefore (GdomeProcessingInstruction *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_pi_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_pi_isSupported (GdomeProcessingInstruction *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_pi_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_pi_normalize (GdomeProcessingInstruction *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.normalize ((GdomeNode *)self, exc); } /** * gdome_pi_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_pi_removeChild (GdomeProcessingInstruction *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_pi_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_pi_replaceChild (GdomeProcessingInstruction *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_pi_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_pi_addEventListener (GdomeProcessingInstruction *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_pi_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_pi_removeEventListener (GdomeProcessingInstruction *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_pi_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_pi_dispatchEvent (GdomeProcessingInstruction *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_pi_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_pi_subTreeDispatchEvent (GdomeProcessingInstruction *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_pi_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_pi_canAppend (GdomeProcessingInstruction *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_ProcessingInstruction *)self)->vtab->super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeXPathNamespace interface API ******************************************************************************/ /** * gdome_xpns_ownerElement: * @self: XPathNamespace Object ref * @exc: Exception Object ref * * NOT IMPLEMENTED * Returns: %NULL */ GdomeElement * gdome_xpns_ownerElement (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_EntityReference *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->ownerElement (self, exc); } /** * gdome_xpns_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_xpns_attributes (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.attributes ((GdomeNode *)self, exc); } /** * gdome_xpns_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_xpns_childNodes (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.childNodes ((GdomeNode *)self, exc); } /** * gdome_xpns_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_xpns_firstChild (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.firstChild ((GdomeNode *)self, exc); } /** * gdome_xpns_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_xpns_lastChild (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.lastChild ((GdomeNode *)self, exc); } /** * gdome_xpns_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_xpns_localName (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.localName ((GdomeNode *)self, exc); } /** * gdome_xpns_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_xpns_namespaceURI (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.namespaceURI ((GdomeNode *)self, exc); } /** * gdome_xpns_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_xpns_nextSibling (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.nextSibling ((GdomeNode *)self, exc); } /** * gdome_xpns_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_xpns_nodeName (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.nodeName ((GdomeNode *)self, exc); } /** * gdome_xpns_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_xpns_nodeType (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.nodeType ((GdomeNode *)self, exc); } /** * gdome_xpns_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_xpns_nodeValue (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.nodeValue ((GdomeNode *)self, exc); } /** * gdome_xpns_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_xpns_set_nodeValue (GdomeXPathNamespace *self, GdomeDOMString *nodeValue, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_XPathNamespace *)self)->vtab->super.set_nodeValue ((GdomeNode *)self, nodeValue, exc); } /** * gdome_xpns_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_xpns_ownerDocument (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.ownerDocument ((GdomeNode *)self, exc); } /** * gdome_xpns_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_xpns_parentNode (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.parentNode ((GdomeNode *)self, exc); } /** * gdome_xpns_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_xpns_prefix (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.prefix ((GdomeNode *)self, exc); } /** * gdome_xpns_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_xpns_set_prefix (GdomeXPathNamespace *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_XPathNamespace *)self)->vtab->super.set_prefix ((GdomeNode *)self, prefix, exc); } /** * gdome_xpns_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_xpns_previousSibling (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.previousSibling ((GdomeNode *)self, exc); } /** * gdome_xpns_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_xpns_ref (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_XPathNamespace *)self)->vtab->super.ref ((GdomeNode *)self, exc); } /** * gdome_xpns_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_xpns_unref (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)self)->n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ((Gdome_xml_XPathNamespace *)self)->vtab->super.unref ((GdomeNode *)self, exc); } /** * gdome_xpns_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xpns_query_interface (GdomeXPathNamespace *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.query_interface ((GdomeNode *)self, interface, exc); } /** * gdome_xpns_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_xpns_appendChild (GdomeXPathNamespace *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.appendChild ((GdomeNode *)self, newChild, exc); } /** * gdome_xpns_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_xpns_cloneNode (GdomeXPathNamespace *self, GdomeBoolean deep, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.cloneNode ((GdomeNode *)self, deep, exc); } /** * gdome_xpns_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_xpns_hasAttributes (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.hasAttributes ((GdomeNode *)self, exc); } /** * gdome_xpns_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_xpns_hasChildNodes (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.hasChildNodes ((GdomeNode *)self, exc); } /** * gdome_xpns_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_xpns_insertBefore (GdomeXPathNamespace *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.insertBefore ((GdomeNode *)self, newChild, refChild, exc); } /** * gdome_xpns_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_xpns_isSupported (GdomeXPathNamespace *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.isSupported ((GdomeNode *)self, feature, version, exc); } /** * gdome_xpns_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_xpns_normalize (GdomeXPathNamespace *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_XPathNamespace *)self)->vtab->super.normalize ((GdomeNode *)self, exc); } /** * gdome_xpns_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_xpns_removeChild (GdomeXPathNamespace *self, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.removeChild ((GdomeNode *)self, oldChild, exc); } /** * gdome_xpns_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_xpns_replaceChild (GdomeXPathNamespace *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.replaceChild ((GdomeNode *)self, newChild, oldChild, exc); } /** * gdome_xpns_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_xpns_addEventListener (GdomeXPathNamespace *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_XPathNamespace *)self)->vtab->super.addEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_xpns_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_xpns_removeEventListener (GdomeXPathNamespace *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_XPathNamespace *)self)->vtab->super.removeEventListener ((GdomeNode *)self, type, listener, useCapture, exc); } /** * gdome_xpns_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_xpns_dispatchEvent (GdomeXPathNamespace *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.dispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_xpns_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_xpns_subTreeDispatchEvent (GdomeXPathNamespace *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_XPathNamespace *)self)->vtab->super.subTreeDispatchEvent ((GdomeNode *)self, evt, exc); } /** * gdome_xpns_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_xpns_canAppend (GdomeXPathNamespace *self, GdomeNode *newChild, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } if (((Gdome_xml_Node *)self)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return FALSE; } *exc = 0; return ((Gdome_xml_XPathNamespace *)self)->vtab->super.canAppend ((GdomeNode *)self, newChild, exc); } /****************************************************************************** GdomeNodeList interface API ******************************************************************************/ /** * gdome_nl_length: * @self: NodeList Object ref * @exc: Exception Object ref * * Returns: the number of nodes in the list. The range of valid child node * indices is 0 to length-1 inclusive. */ gulong gdome_nl_length (GdomeNodeList *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0L; } if (((Gdome_xml_Node *)((Gdome_xml_NodeList *)self)->root)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0L; } *exc = 0; return ((Gdome_xml_NodeList *)self)->vtab->length (self, exc); } /** * gdome_nl_ref: * @self: NodeList Object ref * @exc: Exception Object ref * * Increase the reference count of the specified NodeList. */ void gdome_nl_ref (GdomeNodeList *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_Node *)((Gdome_xml_NodeList *)self)->root)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_NodeList *)self)->vtab->ref (self, exc); } /** * gdome_nl_unref: * @self: NodeList Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified NodeList. Free the NodeList * structure if the specified NodeList will have zero reference. */ void gdome_nl_unref (GdomeNodeList *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_Node *)((Gdome_xml_NodeList *)self)->root)->n == NULL) { if (--((Gdome_xml_NodeList *)self)->refcnt == 0) { gdome_n_unref (((Gdome_xml_NodeList *)self)->root, exc); if(((Gdome_xml_NodeList *)self)->tagName != NULL) gdome_str_unref(((Gdome_xml_NodeList *)self)->tagName); if(((Gdome_xml_NodeList *)self)->tagURI != NULL) gdome_str_unref(((Gdome_xml_NodeList *)self)->tagURI); #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODELIST); #endif g_free (self); } return; } ((Gdome_xml_NodeList *)self)->vtab->unref (self, exc); } /** * gdome_nl_query_interface: * @self: NodeList Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_nl_query_interface (GdomeNodeList *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)((Gdome_xml_NodeList *)self)->root)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_NodeList *)self)->vtab->query_interface (self, interface, exc); } /** * gdome_nl_item: * @self: NodeList Object ref * @index: Index into the collection * @exc: Exception Object ref * * Returns: the indexth item in the collection. If @index is greater than or * equal to the number of nodes in the list, this returns %NULL. */ GdomeNode * gdome_nl_item (GdomeNodeList *self, gulong index, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_Node *)((Gdome_xml_NodeList *)self)->root)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_NodeList *)self)->vtab->item (self, index, exc); } /****************************************************************************** GdomeNamedNodeMap interface API ******************************************************************************/ /** * gdome_nnm_length: * @self: NamedNodeMap Objects ref * @exc: Exception Object ref * * Returns: the number of nodes in this map. The range of valid child node * indices is 0 to length-1 inclusive. */ gulong gdome_nnm_length (GdomeNamedNodeMap *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0L; } if (((Gdome_xml_NamedNodeMap *)self)->type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return 0L; } *exc = 0; return ((Gdome_xml_NamedNodeMap *)self)->vtab->length (self, exc); } /** * gdome_nnm_ref: * @self: NodeList Object ref * @exc: Exception Object ref * * Increase the reference count of the specified NamedNodeMap. */ void gdome_nnm_ref (GdomeNamedNodeMap *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } if (((Gdome_xml_NamedNodeMap *)self)->type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return; } *exc = 0; ((Gdome_xml_NamedNodeMap *)self)->vtab->ref (self, exc); } /** * gdome_nnm_unref: * @self: NodeList Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified NamedNodeMap. Free the * NamedNodeMap structure if the specified NamedNodeMap will have zero * reference. */ void gdome_nnm_unref (GdomeNamedNodeMap *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; if (((Gdome_xml_NamedNodeMap *)self)->type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { if (--((Gdome_xml_NamedNodeMap *)self)->refcnt == 0) { gdome_doc_unref (((Gdome_xml_NamedNodeMap *)self)->doc, exc); gdome_el_unref (((Gdome_xml_NamedNodeMap *)self)->elem, exc); #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NAMEDNODEMAP); #endif g_free (self); } return; } ((Gdome_xml_NamedNodeMap *)self)->vtab->unref (self, exc); } /** * gdome_nnm_query_interface: * @self: NamedNodeMap Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_nnm_query_interface (GdomeNamedNodeMap *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_NamedNodeMap *)self)->type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_NamedNodeMap *)self)->vtab->query_interface (self, interface, exc); } /** * gdome_nnm_getNamedItem: * @self: NamedNodeMap Objects ref * @name: The nodeName of the node to retrieve. * @exc: Exception Object ref * * Retrieves a node specified by name. * Returns: a Node (of any type) with the specified nodeName, or %NULL if it * does not identify any node in this map. */ GdomeNode * gdome_nnm_getNamedItem (GdomeNamedNodeMap *self, GdomeDOMString *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_NamedNodeMap *)self)->type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_NamedNodeMap *)self)->vtab->getNamedItem (self, name, exc); } /** * gdome_nnm_getNamedItemNS: * @self: NamedNodeMap Objects ref * @namespaceURI: The namespace URI of the node to retrieve. * @localName: The local name of the node to retrieve. * @exc: Exception Object ref * * Retrieves a node specified by local name and namespace URI. * Returns: a Node (of any type) with the specified local name and namespace * URI, or %NULL if they do not identify any node in this map. */ GdomeNode * gdome_nnm_getNamedItemNS (GdomeNamedNodeMap *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_NamedNodeMap *)self)->type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_NamedNodeMap *)self)->vtab->getNamedItemNS (self, namespaceURI, localName, exc); } /** * gdome_nnm_item: * @self: NamedNodeMap Objects ref * @index: Index into this map. * @exc: Exception Object ref * * Returns: the indexth item in the map. If index is greater than or equal to * the number of nodes in this map, this returns %NULL. */ GdomeNode * gdome_nnm_item (GdomeNamedNodeMap *self, gulong index, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_NamedNodeMap *)self)->type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_NamedNodeMap *)self)->vtab->item (self, index, exc); } /** * gdome_nnm_removeNamedItem: * @self: NamedNodeMap Objects ref * @name: The nodeName of the node to remove. * @exc: Exception Object ref * * Removes a node specified by name. When this map contains the attributes * attached to an element, if the removed attribute is known to have a default * value, an attribute immediately appears containing the default value as * well as the corresponding namespace URI, local name, and prefix when applicable. * * %GDOME_NOT_FOUND_ERR: Raised if there is no node named @name in this map. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. * Returns: the node removed from this map if a node with such a name exists. */ GdomeNode * gdome_nnm_removeNamedItem (GdomeNamedNodeMap *self, GdomeDOMString *name, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_NamedNodeMap *)self)->type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_NamedNodeMap *)self)->vtab->removeNamedItem (self, name, exc); } /** * gdome_nnm_removeNamedItemNS: * @self: NamedNodeMap Objects ref * @namespaceURI: The namespace URI of the node to remove. * @localName: The local name of the node to remove. * @exc: Exception Object ref * * Removes a node specified by local name and namespace URI. When this map * contains the attributes attached to an element, if the removed attribute * is known to have a default value, an attribute immediately appears * containing the default value as well as the corresponding namespace URI, * local name, and prefix when applicable. * * %GDOME_NOT_FOUND_ERR: Raised if there is no node named @name in this map. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. * Returns: the node removed from this map if a node with such a local name and * namespace URI exists. */ GdomeNode * gdome_nnm_removeNamedItemNS (GdomeNamedNodeMap *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_NamedNodeMap *)self)->type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_NamedNodeMap *)self)->vtab->removeNamedItemNS (self, namespaceURI, localName, exc); } /** * gdome_nnm_setNamedItem: * @self: NamedNodeMap Objects ref * @arg: a node to store in this map. * @exc: Exception Object ref * * Adds a node using its nodeName attribute. If a node with that name is * already present in this map, it is replaced by the new one. * * %GDOME_WRONG_DOCUMENT_ERR: Raised if @arg was created from a different * document than the one that created this map. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. * %GDOME_INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an * attribute of another Element object. The DOM user must explicitly clone * Attr nodes to re-use them in other elements. * Returns: if the new Node replaces an existing node, the replaced Node is * returned, otherwise %NULL is returned. * %GDOME_HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node * doesn't belong in this NamedNodeMap. Examples would include trying to * insert something other than an Attr node into an Element's map of * attributes, or a non-Entity node into the DocumentType's map of Entities. */ GdomeNode * gdome_nnm_setNamedItem (GdomeNamedNodeMap *self, GdomeNode *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_NamedNodeMap *)self)->type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_NamedNodeMap *)self)->vtab->setNamedItem (self, arg, exc); } /** * gdome_nnm_setNamedItemNS: * @self: NamedNodeMap Objects ref * @arg: a node to store in this map. The node will later be accessible * using the value of its namespaceURI and localName attributes. * @exc: Exception Object ref * * Adds a node using its namespaceURI and localName. If a node with that * namespace URI and that local name is already present in this map, it is * replaced by the new one * * %GDOME_WRONG_DOCUMENT_ERR: Raised if @arg was created from a different * document than the one that created this map. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. * %GDOME_INUSE_ATTRIBUTE_ERR: Raised if @arg is an Attr that is already an * attribute of another Element object. The DOM user must explicitly clone * Attr nodes to re-use them in other elements. * Returns: If the new Node replaces an existing node the replaced Node is * returned, otherwise null is returned. * %GDOME_HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node * doesn't belong in this NamedNodeMap. Examples would include trying to * insert something other than an Attr node into an Element's map of * attributes, or a non-Entity node into the DocumentType's map of Entities. */ GdomeNode * gdome_nnm_setNamedItemNS (GdomeNamedNodeMap *self, GdomeNode *arg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } if (((Gdome_xml_NamedNodeMap *)self)->type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { *exc = GDOME_INVALID_STATE_ERR; return NULL; } *exc = 0; return ((Gdome_xml_NamedNodeMap *)self)->vtab->setNamedItemNS (self, arg, exc); } gdome2-0.8.1/libgdome/gdome-events.c0000664000076400007640000006314707625205235012734 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-events.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * CopyRight (C) 2001 Paolo Casarini * * This file is generated automatically. To make changes, edit * test/apigen/events.xml * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "gdome-events.h" #include "gdome-evt-eventl.h" #include "gdome-evt-event.h" #include "gdome-evt-mevent.h" /****************************************************************************** GdomeEventListener interface API ******************************************************************************/ /** * gdome_evntl_aux_mkref: * @callback: the callback function that is to be called when * gdome_evntl_handleEvent() is called. * @priv: private data * @priv_callback: the callback function to be called just before * the event listener is destroyed, so that the * client can do something sensible with the * priv field (like unreffing it) * * Returns: a new allocated #GdomeEventListener. */ GdomeEventListener * gdome_evntl_aux_mkref (void (*callback) (GdomeEventListener *self, GdomeEvent *event, GdomeException *exc), gpointer priv, void (*priv_callback) (GdomeEventListener* self)) { return gdome_evt_evntl_aux_mkref (callback, priv, priv_callback); } /** * gdome_evntl_mkref: * @callback: the callback function that is to be called when * gdome_evntl_handleEvent() is called. * @priv: private data * * Returns: a new allocated #GdomeEventListener. */ GdomeEventListener * gdome_evntl_mkref (void (*callback) (GdomeEventListener *self, GdomeEvent *event, GdomeException *exc), gpointer priv) { return gdome_evt_evntl_mkref (callback, priv); } /** * gdome_evntl_ref: * @self: EventListener Object ref * @exc: Exception Object ref * * Increase the reference count of the specified EventListener. */ void gdome_evntl_ref (GdomeEventListener *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_EventListener *)self)->vtab->ref (self, exc); } /** * gdome_evntl_unref: * @self: EventListener Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified EventListener. Free the * EventListener structure if the EventListener will have zero reference. */ void gdome_evntl_unref (GdomeEventListener *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_EventListener *)self)->vtab->unref (self, exc); } /** * gdome_evntl_query_interface: * @self: EventListener Object ref * @interface: name of the Interface needed. * @exc: Exception Object ref * * Returns: a reference to the object that implements the interface needed or * %NULL if this object doesn't implement the interface specified. */ gpointer gdome_evntl_query_interface (GdomeEventListener *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_EventListener *)self)->vtab->query_interface (self, interface, exc); } /** * gdome_evntl_handleEvent: * @self: EventListener Object ref * @evt: the Event Object ref that contains contextual information about the * event. * @exc: Exception Object ref * * This method is called whenever an event occurs of the type for which the * EventListener interface was registered. */ void gdome_evntl_handleEvent (GdomeEventListener *self, GdomeEvent *evt, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_EventListener *)self)->vtab->handleEvent (self, evt, exc); } /** * gdome_evntl_get_priv: * @self: EventListener Object Ref * * DEPRECATED * Returns: the priv data field associated with this object */ gpointer gdome_evntl_get_priv (GdomeEventListener *self) { return gdome_evt_evntl_get_priv (self); } /****************************************************************************** GdomeEvent interface API ******************************************************************************/ /** * gdome_evnt_bubbles: * @self: Event Object ref * @exc: Exception Object ref * * Returns: If the event can bubble the value is %TRUE, else the value is * %FALSE. */ GdomeBoolean gdome_evnt_bubbles (GdomeEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } *exc = 0; return ((Gdome_evt_Event *)self)->vtab->bubbles (self, exc); } /** * gdome_evnt_cancelable: * @self: Event Object ref * @exc: Exception Object ref * * Returns: If the default action can be prevented the value is %TRUE, else * the value is %FALSE. */ GdomeBoolean gdome_evnt_cancelable (GdomeEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } *exc = 0; return ((Gdome_evt_Event *)self)->vtab->cancelable (self, exc); } /** * gdome_evnt_currentTarget: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the EventTarget whose EventListeners are currently being * processed. This is particularly useful during capturing and bubbling. */ GdomeEventTarget * gdome_evnt_currentTarget (GdomeEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_Event *)self)->vtab->currentTarget (self, exc); } /** * gdome_evnt_eventPhase: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the phase of event flow is currently being evaluated. */ unsigned short gdome_evnt_eventPhase (GdomeEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } *exc = 0; return ((Gdome_evt_Event *)self)->vtab->eventPhase (self, exc); } /** * gdome_evnt_target: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the EventTarget to which the event was originally dispatched. */ GdomeEventTarget * gdome_evnt_target (GdomeEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_Event *)self)->vtab->target (self, exc); } /** * gdome_evnt_timeStamp: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the time (in milliseconds relative to the epoch) at which the * event was created. Due to the fact that some systems may not provide this * information the value of timeStamp may be not available for all events. * When not available, a value of 0 will be returned. Examples of epoch time * are the time of the system start or 0:0:0 UTC 1st January 1970. */ GdomeDOMTimeStamp gdome_evnt_timeStamp (GdomeEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0L; } *exc = 0; return ((Gdome_evt_Event *)self)->vtab->timeStamp (self, exc); } /** * gdome_evnt_type: * @self: Event Object ref * @exc: Exception Object ref * * Returns: The name of the event (case-insensitive). The name must be an XML * name. */ GdomeDOMString * gdome_evnt_type (GdomeEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_Event *)self)->vtab->type (self, exc); } /** * gdome_evnt_mkref: * * Returns: a new allocated #GdomeEvent. */ GdomeEvent * gdome_evnt_mkref (void) { return gdome_evt_evnt_mkref (); } /** * gdome_evnt_ref: * @self: Event Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Event. */ void gdome_evnt_ref (GdomeEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_Event *)self)->vtab->ref (self, exc); } /** * gdome_evnt_unref: * @self: Event Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Event. Free the Event * structure if the Event will have zero reference. */ void gdome_evnt_unref (GdomeEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_Event *)self)->vtab->unref (self, exc); } /** * gdome_evnt_query_interface: * @self: Event Object ref * @interface: name of the Interface needed. * @exc: Exception Object ref * * Returns: a reference to the object that implements the interface needed or * %NULL if this object doesn't implement the interface specified. */ gpointer gdome_evnt_query_interface (GdomeEvent *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_Event *)self)->vtab->query_interface (self, interface, exc); } /** * gdome_evnt_initEvent: * @self: Event Object ref * @eventTypeArg: Specifies the event type. This type may be any event type * currently defined in this specification or a new event type. * The string must be an XML name. * Any new event type must not begin with any upper, lower, or * mixed case version of the string "DOM". * This prefix is reserved for future DOM event sets. It is * also strongly recommended that third parties adding their * own events use their own prefix to avoid confusion and * lessen the probability of conflicts with other new events. * @canBubbleArg: Specifies whether or not the event can bubble. * @cancelableArg: Specifies whether or not the event's default action can be * prevented. * @exc: Exception Object ref * * The initEvent method is used to initialize the value of an Event created * through the gdome_doc_createEvent() API. This method may only be called * before the Event has been dispatched via the dispatchEvent method, though * it may be called multiple times during that phase if necessary. If called * multiple times the final invocation takes precedence. If called from a * subclass of Event interface only the values specified in the initEvent * method are modified, all other attributes are left unchanged. */ void gdome_evnt_initEvent (GdomeEvent *self, GdomeDOMString *eventTypeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_Event *)self)->vtab->initEvent (self, eventTypeArg, canBubbleArg, cancelableArg, exc); } /** * gdome_evnt_preventDefault: * @self: Event Object ref * @exc: Exception Object ref * * If an event is cancelable, the preventDefault method is used to signify * that the event is to be canceled, meaning any default action normally * taken by the implementation as a result of the event will not occur. If, * during any stage of event flow, the preventDefault method is called the * event is canceled. Any default action associated with the event will not * occur. Calling this method for a non-cancelable event has no effect. Once * preventDefault has been called it will remain in effect throughout the * remainder of the event's propagation. This method may be used during any * stage of event flow. */ void gdome_evnt_preventDefault (GdomeEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_Event *)self)->vtab->preventDefault (self, exc); } /** * gdome_evnt_stopPropagation: * @self: Event Object ref * @exc: Exception Object ref * * The stopPropagation method is used prevent further propagation of an event * during event flow. If this method is called by any EventListener the event * will cease propagating through the tree. The event will complete dispatch * to all listeners on the current EventTarget before event flow stops. This * method may be used during any stage of event flow. */ void gdome_evnt_stopPropagation (GdomeEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_Event *)self)->vtab->stopPropagation (self, exc); } /****************************************************************************** GdomeMutationEvent interface API ******************************************************************************/ /** * gdome_mevnt_attrChange: * @self: MutationEvent Object ref * @exc: Exception Object ref * * Returns: the type of change which triggered the DOMAttrModified event. * The values can be %MODIFICATION, %ADDITION, or %REMOVAL. If an error * occur, %0 is returned. */ gushort gdome_mevnt_attrChange (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->attrChange (self, exc); } /** * gdome_mevnt_attrName: * @self: MutationEvent Object ref * @exc: Exception Object ref * * Returns: the name of the changed Attr node in a DOMAttrModified event. */ GdomeDOMString * gdome_mevnt_attrName (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->attrName (self, exc); } /** * gdome_mevnt_newValue: * @self: MutationEvent Object ref * @exc: Exception Object ref * * Returns: the new value of the Attr node in DOMAttrModified events, * and of the CharacterData node in DOMCharDataModified events. */ GdomeDOMString * gdome_mevnt_newValue (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->newValue (self, exc); } /** * gdome_mevnt_prevValue: * @self: MutationEvent Object ref * @exc: Exception Object ref * * Returns: the previous value of the Attr node in DOMAttrModified events, * and of the CharacterData node in DOMCharDataModified events. */ GdomeDOMString * gdome_mevnt_prevValue (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->prevValue (self, exc); } /** * gdome_mevnt_relatedNode: * @self: MutationEvent Object ref * @exc: Exception Object ref * * Returns: a secondary node related to a mutation event. For example, if a * mutation event is dispatched to a node indicating that its parent has * changed, the relatedNode is the changed parent. If an event is instead * dispatched to a subtree indicating a node was changed within it, the * relatedNode is the changed node. In the case of the DOMAttrModified event * it indicates the Attr node which was modified, added, or removed. */ GdomeNode * gdome_mevnt_relatedNode (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->relatedNode (self, exc); } /** * gdome_mevnt_mkref: * * Returns: a new allocated #GdomeMutationEvent. */ GdomeMutationEvent * gdome_mevnt_mkref (void) { return gdome_evt_mevnt_mkref (); } /** * gdome_mevnt_initMutationEvent: * @self: MutationEvent Object ref * @typeArg: Specifies the event type. * @canBubbleArg: Specifies whether or not the event can bubble. * @cancelableArg: Specifies whether or not the event's default action * can be prevented. * @relatedNodeArg: Specifies the Event's related Node. This value may * be %NULL. * @prevValueArg: Specifies the Event's prevValue attribute. This value * may be %NULL. * @newValueArg: Specifies the Event's newValue attribute. This value * may be %NULL. * @attrNameArg: Specifies the Event's attrName attribute. This value * may be null. * @attrChangeArg: Specifies the Event's attrChange attribute * @exc: Exception Object ref * * The initMutationEvent method is used to initialize the value of a * #GdomeMutationEvent created through the DocumentEvent interface. This * method may only be called before the MutationEvent has been dispatched * via the dispatchEvent method, though it may be called multiple times * during that phase if necessary. If called multiple times, the final * invocation takes precedence. */ void gdome_mevnt_initMutationEvent (GdomeMutationEvent *self, GdomeDOMString *typeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeNode *relatedNodeArg, GdomeDOMString *prevValueArg, GdomeDOMString *newValueArg, GdomeDOMString *attrNameArg, gushort attrChangeArg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_MutationEvent *)self)->vtab->initMutationEvent (self, typeArg, canBubbleArg, cancelableArg, relatedNodeArg, prevValueArg, newValueArg, attrNameArg, attrChangeArg, exc); } /** * gdome_mevnt_bubbles: * @self: Event Object ref * @exc: Exception Object ref * * Returns: If the event can bubble the value is %TRUE, else the value is * %FALSE. */ GdomeBoolean gdome_mevnt_bubbles (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->super.bubbles ((GdomeEvent *)self, exc); } /** * gdome_mevnt_cancelable: * @self: Event Object ref * @exc: Exception Object ref * * Returns: If the default action can be prevented the value is %TRUE, else * the value is %FALSE. */ GdomeBoolean gdome_mevnt_cancelable (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->super.cancelable ((GdomeEvent *)self, exc); } /** * gdome_mevnt_currentTarget: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the EventTarget whose EventListeners are currently being * processed. This is particularly useful during capturing and bubbling. */ GdomeEventTarget * gdome_mevnt_currentTarget (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->super.currentTarget ((GdomeEvent *)self, exc); } /** * gdome_mevnt_eventPhase: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the phase of event flow is currently being evaluated. */ unsigned short gdome_mevnt_eventPhase (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->super.eventPhase ((GdomeEvent *)self, exc); } /** * gdome_mevnt_target: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the EventTarget to which the event was originally dispatched. */ GdomeEventTarget * gdome_mevnt_target (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->super.target ((GdomeEvent *)self, exc); } /** * gdome_mevnt_timeStamp: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the time (in milliseconds relative to the epoch) at which the * event was created. Due to the fact that some systems may not provide this * information the value of timeStamp may be not available for all events. * When not available, a value of 0 will be returned. Examples of epoch time * are the time of the system start or 0:0:0 UTC 1st January 1970. */ GdomeDOMTimeStamp gdome_mevnt_timeStamp (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0L; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->super.timeStamp ((GdomeEvent *)self, exc); } /** * gdome_mevnt_type: * @self: Event Object ref * @exc: Exception Object ref * * Returns: The name of the event (case-insensitive). The name must be an XML * name. */ GdomeDOMString * gdome_mevnt_type (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->super.type ((GdomeEvent *)self, exc); } /** * gdome_mevnt_ref: * @self: Event Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Event. */ void gdome_mevnt_ref (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_MutationEvent *)self)->vtab->super.ref ((GdomeEvent *)self, exc); } /** * gdome_mevnt_unref: * @self: Event Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Event. Free the Event * structure if the Event will have zero reference. */ void gdome_mevnt_unref (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_MutationEvent *)self)->vtab->super.unref ((GdomeEvent *)self, exc); } /** * gdome_mevnt_query_interface: * @self: Event Object ref * @interface: name of the Interface needed. * @exc: Exception Object ref * * Returns: a reference to the object that implements the interface needed or * %NULL if this object doesn't implement the interface specified. */ gpointer gdome_mevnt_query_interface (GdomeMutationEvent *self, const char *interface, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_evt_MutationEvent *)self)->vtab->super.query_interface ((GdomeEvent *)self, interface, exc); } /** * gdome_mevnt_initEvent: * @self: Event Object ref * @eventTypeArg: Specifies the event type. This type may be any event type * currently defined in this specification or a new event type. * The string must be an XML name. * Any new event type must not begin with any upper, lower, or * mixed case version of the string "DOM". * This prefix is reserved for future DOM event sets. It is * also strongly recommended that third parties adding their * own events use their own prefix to avoid confusion and * lessen the probability of conflicts with other new events. * @canBubbleArg: Specifies whether or not the event can bubble. * @cancelableArg: Specifies whether or not the event's default action can be * prevented. * @exc: Exception Object ref * * The initEvent method is used to initialize the value of an Event created * through the gdome_doc_createEvent() API. This method may only be called * before the Event has been dispatched via the dispatchEvent method, though * it may be called multiple times during that phase if necessary. If called * multiple times the final invocation takes precedence. If called from a * subclass of Event interface only the values specified in the initEvent * method are modified, all other attributes are left unchanged. */ void gdome_mevnt_initEvent (GdomeMutationEvent *self, GdomeDOMString *eventTypeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_MutationEvent *)self)->vtab->super.initEvent ((GdomeEvent *)self, eventTypeArg, canBubbleArg, cancelableArg, exc); } /** * gdome_mevnt_preventDefault: * @self: Event Object ref * @exc: Exception Object ref * * If an event is cancelable, the preventDefault method is used to signify * that the event is to be canceled, meaning any default action normally * taken by the implementation as a result of the event will not occur. If, * during any stage of event flow, the preventDefault method is called the * event is canceled. Any default action associated with the event will not * occur. Calling this method for a non-cancelable event has no effect. Once * preventDefault has been called it will remain in effect throughout the * remainder of the event's propagation. This method may be used during any * stage of event flow. */ void gdome_mevnt_preventDefault (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_MutationEvent *)self)->vtab->super.preventDefault ((GdomeEvent *)self, exc); } /** * gdome_mevnt_stopPropagation: * @self: Event Object ref * @exc: Exception Object ref * * The stopPropagation method is used prevent further propagation of an event * during event flow. If this method is called by any EventListener the event * will cease propagating through the tree. The event will complete dispatch * to all listeners on the current EventTarget before event flow stops. This * method may be used during any stage of event flow. */ void gdome_mevnt_stopPropagation (GdomeMutationEvent *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_evt_MutationEvent *)self)->vtab->super.stopPropagation ((GdomeEvent *)self, exc); } gdome2-0.8.1/libgdome/gdome-xpath.c0000664000076400007640000002416607437576325012566 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xpath.c * * CopyRight (C) 2002 T.J. Mather * * This file is generated automatically. To make changes, edit * test/apigen/xpath.xml * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "gdome.h" #include "gdome-xml-node.h" #include "gdome-xpath.h" #include "gdome-xpath-xpeval.h" #include "gdome-xpath-xpresult.h" #include "gdome-xpath-xpnsresolv.h" /****************************************************************************** GdomeXPathEvaluator interface API ******************************************************************************/ /** * gdome_xpeval_mkref: * * Constructor of the XPathEvaluator interface. * Returns: the reference to the XPathEvaluator structure. */ GdomeXPathEvaluator * gdome_xpeval_mkref (void) { return gdome_xpath_xpeval_mkref (); } /** * gdome_xpeval_ref: * @self: XPathEvaluator Object ref * @exc: Exception Object ref * * Increase the reference count of the XPathEvaluator structure. */ void gdome_xpeval_ref (GdomeXPathEvaluator *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_xpath_XPathEvaluator *)self)->vtab->ref (self, exc); } /** * gdome_xpeval_unref: * @self: XPathEvaluator Object ref * @exc: Exception Object ref * * Decrease the reference count of the XPathEvaluator. Free the structure * if XPathEvaluator will have zero reference. */ void gdome_xpeval_unref (GdomeXPathEvaluator *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_xpath_XPathEvaluator *)self)->vtab->unref (self, exc); } /** * gdome_xpeval_createNSResolver: * @self: GdomeXPathEvaluator Object ref * @nodeResolver: The node to be used as a context for namespace resolution. * @exc: Exception Object ref * * Adapts any DOM node to resolve namespaces so that an XPath expression * can be easily evaluated relative to the context of the node where it * appeared within the document. * Returns: GdomeXPathNSResolver object. */ GdomeXPathNSResolver * gdome_xpeval_createNSResolver (GdomeXPathEvaluator *self, GdomeNode *nodeResolver, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xpath_XPathEvaluator *)self)->vtab->createNSResolver (self, nodeResolver, exc); } /** * gdome_xpeval_createResult: * @self: GdomeXPathEvaluator Object ref * @exc: Exception Object ref * * Returns: an GdomeXPathResult object which may be passed as a parameter to the * evaluation methods of this GdomeXPathEvaluator so that a new one is not * created on each call to an evaluation method. */ GdomeXPathResult * gdome_xpeval_createResult (GdomeXPathEvaluator *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xpath_XPathEvaluator *)self)->vtab->createResult (self, exc); } /** * gdome_xpeval_evaluate: * @self: GdomeXPathEvaluator Object ref * @expression: The XPath expression string to be parsed and evaluated. * @contextNode: Context node for the evaluation of this XPath expression. * @resolver: The resolver permits translation of prefixes within the XPath * expression into appropriate namespace URIs. * @type: If specified, result will be coerced to return the specified type. * @result: Specifies a GdomeXPathResult object to be re-used. * @exc: Exception Object ref * * Evaluates an XPath expression string * Returns: a result of the specified type if possible. */ GdomeXPathResult * gdome_xpeval_evaluate (GdomeXPathEvaluator *self, GdomeDOMString *expression, GdomeNode *contextNode, GdomeXPathNSResolver *resolver, unsigned int type, GdomeXPathResult *result, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xpath_XPathEvaluator *)self)->vtab->evaluate (self, expression, contextNode, resolver, type, result, exc); } /****************************************************************************** GdomeXPathNSResolver interface API ******************************************************************************/ /** * gdome_xpnsresolv_ref: * @self: XPathNSResolver Object ref * @exc: Exception Object ref * * Increase the reference count of the XPathNSResolver structure. */ void gdome_xpnsresolv_ref (GdomeXPathNSResolver *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_xpath_XPathNSResolver *)self)->vtab->ref (self, exc); } /** * gdome_xpnsresolv_unref: * @self: XPathNSResolver Object ref * @exc: Exception Object ref * * Decrease the reference count of the XPathNSResolver. Free the structure * if XPathNSResolver will have zero reference. */ void gdome_xpnsresolv_unref (GdomeXPathNSResolver *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_xpath_XPathNSResolver *)self)->vtab->unref (self, exc); } /** * gdome_xpnsresolv_lookupNamespaceURI: * @self: GdomeXPathNSResolver Object ref * @prefix: The prefix of the namespace to look for * @exc: Exception Object ref * * Look up the namespace URI associated to the given namespace prefix. The * XPath evaluator must never call this with a null or empty argument, because * the result of doing this is undefined. * Returns: namespace URI */ GdomeDOMString * gdome_xpnsresolv_lookupNamespaceURI (GdomeXPathNSResolver *self, GdomeDOMString *prefix, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xpath_XPathNSResolver *)self)->vtab->lookupNamespaceURI (self, prefix, exc); } /****************************************************************************** GdomeXPathResult interface API ******************************************************************************/ /** * gdome_xpresult_ref: * @self: XPathResult Object ref * @exc: Exception Object ref * * Increase the reference count of the XPathResult structure. */ void gdome_xpresult_ref (GdomeXPathResult *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_xpath_XPathResult *)self)->vtab->ref (self, exc); } /** * gdome_xpresult_unref: * @self: XPathResult Object ref * @exc: Exception Object ref * * Decrease the reference count of the XPathResult. Free the structure * if XPathResult will have zero reference. */ void gdome_xpresult_unref (GdomeXPathResult *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return; } *exc = 0; ((Gdome_xpath_XPathResult *)self)->vtab->unref (self, exc); } /** * gdome_xpresult_resultType: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Returns: a code representing the type of this result, as defined by the type * constants. */ unsigned short gdome_xpresult_resultType (GdomeXPathResult *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } *exc = 0; return ((Gdome_xpath_XPathResult *)self)->vtab->resultType (self, exc); } /** * gdome_xpresult_booleanValue: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Returns: the value of this boolean result. */ GdomeBoolean gdome_xpresult_booleanValue (GdomeXPathResult *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return FALSE; } *exc = 0; return ((Gdome_xpath_XPathResult *)self)->vtab->booleanValue (self, exc); } /** * gdome_xpresult_numberValue: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Returns: the value of this number result. */ double gdome_xpresult_numberValue (GdomeXPathResult *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return 0; } *exc = 0; return ((Gdome_xpath_XPathResult *)self)->vtab->numberValue (self, exc); } /** * gdome_xpresult_stringValue: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Returns: the value of this GdomeDOMString result. */ GdomeDOMString * gdome_xpresult_stringValue (GdomeXPathResult *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xpath_XPathResult *)self)->vtab->stringValue (self, exc); } /** * gdome_xpresult_singleNodeValue: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Returns: The value of this single node result, which may be %NULL. This result is not * guaranteed to be the first node in document order where the expression * evaluates to multiple nodes. */ GdomeNode * gdome_xpresult_singleNodeValue (GdomeXPathResult *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xpath_XPathResult *)self)->vtab->singleNodeValue (self, exc); } /** * gdome_xpresult_iterateNext: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Iterates and returns the next node from the node set or %NULL if there * are no more nodes. * Returns: the next node. */ GdomeNode * gdome_xpresult_iterateNext (GdomeXPathResult *self, GdomeException *exc) { if (self == NULL) { *exc = GDOME_NULL_POINTER_ERR; return NULL; } *exc = 0; return ((Gdome_xpath_XPathResult *)self)->vtab->iterateNext (self, exc); } gdome2-0.8.1/libgdome/gdome-util.c0000664000076400007640000000717107377235637012415 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-util.c * * CopyRight (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "gdome-xml-node.h" #include "gdome-xml-util.h" #include "gdome-evt-util.h" #include "gdome-evt-event.h" GdomeAttr * gdome_cast_a (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_A(node)) return NULL; else return (GdomeAttr *)node; } GdomeCharacterData * gdome_cast_cd (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_CD(node)) return NULL; else return (GdomeCharacterData *)node; } GdomeCDATASection * gdome_cast_cds (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_CDS(node)) return NULL; else return (GdomeCDATASection *)node; } GdomeComment * gdome_cast_c (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_C(node)) return NULL; else return (GdomeComment *)node; } GdomeDocument * gdome_cast_doc (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_DOC(node)) return NULL; else return (GdomeDocument *)node; } GdomeDocumentFragment * gdome_cast_df (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_DF(node)) return NULL; else return (GdomeDocumentFragment *)node; } GdomeDocumentType * gdome_cast_dt (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_DT(node)) return NULL; else return (GdomeDocumentType *)node; } GdomeElement * gdome_cast_el (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_EL(node)) return NULL; else return (GdomeElement *)node; } GdomeEntity * gdome_cast_ent (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_ENT(node)) return NULL; else return (GdomeEntity *)node; } GdomeEntityReference * gdome_cast_er (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_ER(node)) return NULL; else return (GdomeEntityReference *)node; } GdomeNode * gdome_cast_n (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_N(node)) return NULL; else return (GdomeNode *)node; } GdomeNotation * gdome_cast_not (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_NOT(node)) return NULL; else return (GdomeNotation *)node; } GdomeProcessingInstruction * gdome_cast_pi (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_PI(node)) return NULL; else return (GdomeProcessingInstruction *)node; } GdomeText * gdome_cast_t (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_T(node)) return NULL; else return (GdomeText *)node; } GdomeEventTarget * gdome_cast_evntt (GdomeNode *node) { if (node == NULL || !GDOME_XML_IS_N(node)) return NULL; else return (GdomeEventTarget *)node; } GdomeEvent * gdome_cast_evnt (GdomeEvent *evt) { if (evt == NULL || !GDOME_XML_IS_EVNT(evt)) return NULL; else return (GdomeEvent *)evt; } GdomeMutationEvent * gdome_cast_mevnt (GdomeEvent *evt) { if (evt == NULL || !GDOME_XML_IS_MEVNT(evt)) return NULL; else return (GdomeMutationEvent *)evt; } gdome2-0.8.1/libgdome/gdome-private-list.c0000664000076400007640000000702007311512646014036 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-private-list.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2000 Anders Carlsson * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "gdome-private-list.h" /** * gdome_private_list_append: * @list: a pointer to the list to which append a new element * @data: a pointer to the data that we want to add to the list * * Append a new element containing @data to the list specified. * Returns: the list with the new element appended. */ GdomePrivateList * gdome_private_list_append (GdomePrivateList *list, void *data) { GdomePrivateList *new_list; new_list = malloc (sizeof (GdomePrivateList)); new_list->data = data; new_list->next = NULL; if (list) { while (list->next) list = list->next; list->next = new_list; return list; } else return new_list; } /** * gdome_private_list_prepend: * @list: a pointer to the list to which add a new element in the first position * @data: a pointer to the data that we want to add to the list * * Add a new element containing @data at the first position of list * specified. * Returns the list with the new element added. */ GdomePrivateList * gdome_private_list_prepend (GdomePrivateList *list, void *data) { GdomePrivateList *new_list; new_list = malloc (sizeof (GdomePrivateList)); new_list->data = data; new_list->next = list; return new_list; } /** * gdome_private_list_length: * @list: a pointer to a list * * Returns: the number of elements in the list specified. */ unsigned int gdome_private_list_length (GdomePrivateList *list) { unsigned int length; length = 0; while (list) { length++; list = list->next; } return length; } /** * gdome_private_list_remove: * @list: a pointer to the list to which remove an element * @data: the pointer to the data that is to be removed from the list * * Remove the element containing @data from the list. * Returns: the resulted list. */ GdomePrivateList * gdome_private_list_remove (GdomePrivateList *list, void *data) { GdomePrivateList *tmp, *prev; tmp = list; prev = NULL; while (tmp) { if (tmp->data == data) { if (prev) prev->next = tmp->next; if (list == tmp) list = list->next; tmp->next = NULL; free (tmp); break; } prev = tmp; tmp = tmp->next; } return list; } /** * gdome_private_list_nth: * @list: a pointer to the list of which the nth element is wanted * @n: the index to the element wanted * * Returns: a pointer to the nth element of the list specified. */ GdomePrivateList * gdome_private_list_nth (GdomePrivateList *list, unsigned int n) { while ((n-- > 0) && list) list = list->next; return list; } gdome2-0.8.1/libgdome/gdome-refdebug.c0000664000076400007640000000442107737315573013214 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-refdebug.c * * CopyRight (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include "gdome.h" #include "gdome-events.h" #include "gdome-private-list.h" #include "gdome-xml-node.h" #include "gdome-xml-nodel.h" #include "gdome-xml-nnodem.h" #include "gdome-evt-event.h" #include "gdome-evt-eventl.h" #include "gdome-refdebug.h" #define NUMOFLISTS 6 GdomePrivateList *refDebug[NUMOFLISTS]; void gdome_refdbg_addRef (void *ref, GdomeRefType type) { refDebug[type] = gdome_private_list_prepend (refDebug[type], ref); } gint gdome_refdbg_numRef (void *ref, GdomeRefType type) { GdomePrivateList *l; void * res = NULL; for (l = refDebug[type]; l != NULL && res == NULL; l = l->next) if (l->data == ref) res = l->data; if (res) switch (type) { case GDOME_REFDBG_STR: return ((GdomeDOMString *)res)->refcnt; case GDOME_REFDBG_NODE: return ((Gdome_xml_Node *)res)->refcnt; case GDOME_REFDBG_NODELIST: return ((Gdome_xml_NodeList *)res)->refcnt; case GDOME_REFDBG_NAMEDNODEMAP: return ((Gdome_xml_NamedNodeMap *)res)->refcnt; case GDOME_REFDBG_EVENT: return ((Gdome_evt_Event *)res)->refcnt; case GDOME_REFDBG_EVENTLISTENER: return ((Gdome_evt_EventListener *)res)->refcnt; default: g_warning ("RefDebug, numRef: BAD TYPE\n"); } return -1; } void gdome_refdbg_delRef (void *ref, GdomeRefType type) { refDebug[type] = gdome_private_list_remove(refDebug[type], ref); } gdome2-0.8.1/libgdome/gdome-treegc.c0000664000076400007640000000614307740025622012670 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-treegc.c * * CopyRight (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "gdome.h" #include "gdome-events.h" #include "gdome-refdebug.h" #include #include "gdome-xml-util.h" #include "gdome-xml-xmlutil.h" #include "gdome-xml-node.h" #include "gdome-xml-document.h" /** * gdome_treegc_addNode: * @node: the wrapper to register * * Increase the livenodes field */ void gdome_treegc_addNode (GdomeNode *node) { Gdome_xml_Node *priv = (Gdome_xml_Node *)node; Gdome_xml_Document *ownerDoc; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_N(priv)); ownerDoc = gdome_xmlGetOwner (priv->n)->_private; g_assert (ownerDoc != NULL); ownerDoc->livenodes++; } /** * gdome_treegc_delNode: * @node: the wrapper to un-register * * Decrease the livenodes field. If the field reaches zero * (that is, there are no more live wrappers) free the whole document tree */ void gdome_treegc_delNode (GdomeNode *node) { Gdome_xml_Node *priv = (Gdome_xml_Node *)node; Gdome_xml_Document *ownerDoc; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_N(priv)); ownerDoc = gdome_xmlGetOwner (priv->n)->_private; g_assert (ownerDoc != NULL); ownerDoc->livenodes--; if (ownerDoc->livenodes == 0) { ownerDoc->n->_private = NULL; #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)ownerDoc, GDOME_REFDBG_NODE); #endif xmlFreeDoc (ownerDoc->n); g_free (ownerDoc); } } /** * gdome_treegc_invalidateNode: * @node: the wrapper to invalidate * * Set the n field of the wrapper to NULL and * decrease the livenode field of the document */ void gdome_treegc_invalidateNode (GdomeNode *node) { Gdome_xml_Node *priv = (Gdome_xml_Node *)node; g_return_if_fail (priv != NULL); g_return_if_fail (priv->n != NULL); gdome_treegc_delNode (node); priv->n = NULL; } /** * gdome_treegc_livenodes: * @node: a node in the Document main tree * * Returns the number of live nodes in the Document main tree. */ int gdome_treegc_livenodes (GdomeNode *node) { Gdome_xml_Node *priv = (Gdome_xml_Node *)node; Gdome_xml_Document *ownerDoc; g_return_val_if_fail (priv != NULL, -1); g_return_val_if_fail (GDOME_XML_IS_N(priv), -1); ownerDoc = gdome_xmlGetOwner (priv->n)->_private; g_assert (ownerDoc != NULL); return ownerDoc->livenodes; } gdome2-0.8.1/libgdome/gdome.h0000664000076400007640000022303707702626137011437 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ----- gdome.h ----- */ #ifndef GDOME_H #define GDOME_H #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* error types for our exception handling system. */ typedef enum { GDOME_NOEXCEPTION_ERR = 0, GDOME_INDEX_SIZE_ERR = 1, GDOME_DOMSTRING_SIZE_ERR = 2, GDOME_HIERARCHY_REQUEST_ERR = 3, GDOME_WRONG_DOCUMENT_ERR = 4, GDOME_INVALID_CHARACTER_ERR = 5, GDOME_NO_DATA_ALLOWED_ERR = 6, GDOME_NO_MODIFICATION_ALLOWED_ERR = 7, GDOME_NOT_FOUND_ERR = 8, GDOME_NOT_SUPPORTED_ERR = 9, GDOME_INUSE_ATTRIBUTE_ERR = 10, GDOME_INVALID_STATE_ERR = 11, GDOME_SYNTAX_ERR = 12, GDOME_INVALID_MODIFICATION_ERR = 13, GDOME_NAMESPACE_ERR = 14, GDOME_INVALID_ACCESS_ERR = 15, GDOME_NULL_POINTER_ERR = 100 } GdomeExceptionCode; typedef enum { GDOME_CORE_EXCEPTION = 0 << 16, GDOME_EVENT_EXCEPTION = 1 << 16, GDOME_XPATH_EXCEPTION = 2 << 16 } GdomeExceptionType; typedef enum { GDOME_EXCEPTION_TYPE_MASK = 0x00FF0000, GDOME_EXCEPTION_CODE_MASK = 0x0000FFFF } GdomeExceptionMasks; /* Exception Handling Macros */ #define GDOME_EXCEPTION_TYPE(exc) ((exc) & GDOME_EXCEPTION_TYPE_MASK) #define GDOME_EXCEPTION_CODE(exc) ((exc) & GDOME_EXCEPTION_CODE_MASK) /* access type for node handles */ typedef enum { GDOME_READONLY_NODE = 0, GDOME_READWRITE_NODE = 1 } GdomeAccessType; typedef enum { GDOME_LOAD_PARSING = 0, GDOME_LOAD_VALIDATING = 1, GDOME_LOAD_RECOVERING = 2, GDOME_LOAD_SUBSTITUTE_ENTITIES = 4, GDOME_LOAD_COMPLETE_ATTRS = 8 } GdomeLoadingCode; typedef enum { GDOME_SAVE_STANDARD = 0, GDOME_SAVE_LIBXML_INDENT = 1 } GdomeSavingCode; typedef struct _GdomeDOMString GdomeDOMString; typedef int GdomeBoolean; typedef guint32 GdomeException; typedef long long GdomeDOMTimeStamp; struct _GdomeDOMString { gchar *str; gint refcnt; void (*unref) (GdomeDOMString *self); }; typedef struct _GdomeNode GdomeNode; typedef GdomeNode GdomeEventTarget; typedef struct _GdomeAttr GdomeAttr; typedef struct _GdomeCharacterData GdomeCharacterData; typedef struct _GdomeText GdomeText; typedef struct _GdomeCDATASection GdomeCDATASection; typedef struct _GdomeComment GdomeComment; typedef struct _GdomeDOMImplementation GdomeDOMImplementation; typedef struct _GdomeDocument GdomeDocument; typedef struct _GdomeDocumentFragment GdomeDocumentFragment; typedef struct _GdomeDocumentType GdomeDocumentType; typedef struct _GdomeElement GdomeElement; typedef struct _GdomeEntity GdomeEntity; typedef struct _GdomeEntityReference GdomeEntityReference; typedef struct _GdomeNamedNodeMap GdomeNamedNodeMap; typedef struct _GdomeNodeList GdomeNodeList; typedef struct _GdomeNotation GdomeNotation; typedef struct _GdomeProcessingInstruction GdomeProcessingInstruction; /* Events interfaces */ typedef struct _GdomeEvent GdomeEvent; typedef struct _GdomeEventListener GdomeEventListener; typedef struct _GdomeMutationEvent GdomeMutationEvent; typedef struct _GnomeNode GnomeEventTarget; typedef struct _GnomeDocument GnomeDocumentEvent; /* XPath interfaces */ typedef struct _GdomeXPathEvaluator GdomeXPathEvaluator; typedef struct _GdomeXPathNamespace GdomeXPathNamespace; typedef struct _GdomeXPathNSResolver GdomeXPathNSResolver; typedef struct _GdomeXPathResult GdomeXPathResult; /* Traversal interfaces */ typedef struct _GdomeNodeFilter GdomeNodeFilter; typedef struct _GdomeNodeIterator GdomeNodeIterator; typedef struct _GdomeTreeWalker GdomeTreeWalker; typedef struct _GdomeNodeVtab GdomeNodeVtab; typedef struct _GdomeAttrVtab GdomeAttrVtab; typedef struct _GdomeCharacterDataVtab GdomeCharacterDataVtab; typedef struct _GdomeTextVtab GdomeTextVtab; typedef struct _GdomeCDATASectionVtab GdomeCDATASectionVtab; typedef struct _GdomeCommentVtab GdomeCommentVtab; typedef struct _GdomeDOMImplementationVtab GdomeDOMImplementationVtab; typedef struct _GdomeDocumentVtab GdomeDocumentVtab; typedef struct _GdomeDocumentFragmentVtab GdomeDocumentFragmentVtab; typedef struct _GdomeDocumentTypeVtab GdomeDocumentTypeVtab; typedef struct _GdomeElementVtab GdomeElementVtab; typedef struct _GdomeEntityVtab GdomeEntityVtab; typedef struct _GdomeEntityReferenceVtab GdomeEntityReferenceVtab; typedef struct _GdomeNamedNodeMapVtab GdomeNamedNodeMapVtab; typedef struct _GdomeNodeListVtab GdomeNodeListVtab; typedef struct _GdomeNotationVtab GdomeNotationVtab; typedef struct _GdomeProcessingInstructionVtab GdomeProcessingInstructionVtab; typedef struct _GdomeXPathNamespaceVtab GdomeXPathNamespaceVtab; typedef enum { GDOME_ELEMENT_NODE = 1, GDOME_ATTRIBUTE_NODE = 2, GDOME_TEXT_NODE = 3, GDOME_CDATA_SECTION_NODE = 4, GDOME_ENTITY_REFERENCE_NODE = 5, GDOME_ENTITY_NODE = 6, GDOME_PROCESSING_INSTRUCTION_NODE = 7, GDOME_COMMENT_NODE = 8, GDOME_DOCUMENT_NODE = 9, GDOME_DOCUMENT_TYPE_NODE = 10, GDOME_DOCUMENT_FRAGMENT_NODE = 11, GDOME_NOTATION_NODE = 12, GDOME_XPATH_NAMESPACE_NODE = 13 } GdomeNodeType; typedef struct _GdomeEntitiesTableEntry GdomeEntitiesTableEntry; struct _GdomeEntitiesTableEntry { gchar *name; gchar *value; gchar *publicID; gchar *systemID; }; struct _GdomeNode { gpointer user_data; }; struct _GdomeAttr { gpointer user_data; }; struct _GdomeCharacterData { gpointer user_data; }; struct _GdomeText { gpointer user_data; }; struct _GdomeCDATASection { gpointer user_data; }; struct _GdomeComment { gpointer user_data; }; struct _GdomeDOMImplementation { gpointer user_data; }; struct _GdomeDocument { gpointer user_data; }; struct _GdomeDocumentFragment { gpointer user_data; }; struct _GdomeDocumentType { gpointer user_data; }; struct _GdomeElement { gpointer user_data; }; struct _GdomeEntity { gpointer user_data; }; struct _GdomeEntityReference { gpointer user_data; }; struct _GdomeNamedNodeMap { gpointer user_data; }; struct _GdomeNodeList { gpointer user_data; }; struct _GdomeNotation { gpointer user_data; }; struct _GdomeProcessingInstruction { gpointer user_data; }; struct _GdomeXPathNamespace { gpointer user_data; }; /* Public API of Gdome */ /*-------------------------- DOMString -------------------------- */ GdomeDOMString *gdome_str_mkref (const gchar *str); GdomeDOMString *gdome_str_mkref_own (gchar *str); GdomeDOMString *gdome_str_mkref_dup (const gchar *str); void gdome_str_ref (GdomeDOMString *self); void gdome_str_unref (GdomeDOMString *self); GdomeBoolean gdome_str_equal (GdomeDOMString *self, GdomeDOMString *str); GdomeBoolean gdome_str_equalIgnoreCase (GdomeDOMString *self, GdomeDOMString *str); gchar gdome_str_charAt (GdomeDOMString *self, int index); GdomeDOMString *gdome_str_concat (GdomeDOMString *self, GdomeDOMString *str); GdomeBoolean gdome_str_endsWith (GdomeDOMString *self, GdomeDOMString *suffix); GdomeBoolean gdome_str_isEmpty (GdomeDOMString *self); int gdome_str_length (GdomeDOMString *self); GdomeBoolean gdome_str_startsWith (GdomeDOMString *self, GdomeDOMString *prefix); /* --------------------------- Node --------------------------- */ void gdome_n_ref (GdomeNode *self, GdomeException *exc); void gdome_n_unref (GdomeNode *self, GdomeException *exc); gpointer gdome_n_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); GdomeDOMString * gdome_n_nodeName (GdomeNode *self, GdomeException *exc); GdomeDOMString * gdome_n_nodeValue (GdomeNode *self, GdomeException *exc); void gdome_n_set_nodeValue (GdomeNode *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_n_nodeType (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_n_parentNode (GdomeNode *self, GdomeException *exc); GdomeNodeList * gdome_n_childNodes (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_n_firstChild (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_n_lastChild (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_n_previousSibling (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_n_nextSibling (GdomeNode *self, GdomeException *exc); GdomeNamedNodeMap * gdome_n_attributes (GdomeNode *self, GdomeException *exc); GdomeDocument * gdome_n_ownerDocument (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_n_insertBefore (GdomeNode *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode * gdome_n_replaceChild (GdomeNode *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode * gdome_n_removeChild (GdomeNode *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode * gdome_n_appendChild (GdomeNode *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_n_hasChildNodes (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_n_cloneNode (GdomeNode *self, GdomeBoolean deep, GdomeException *exc); void gdome_n_normalize (GdomeNode *self, GdomeException *exc); GdomeBoolean gdome_n_isSupported (GdomeNode *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString * gdome_n_namespaceURI (GdomeNode *self, GdomeException *exc); GdomeDOMString * gdome_n_prefix (GdomeNode *self, GdomeException *exc); void gdome_n_set_prefix (GdomeNode *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString * gdome_n_localName (GdomeNode *self, GdomeException *exc); GdomeBoolean gdome_n_hasAttributes (GdomeNode *self, GdomeException *exc); void gdome_n_addEventListener (GdomeNode *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_n_removeEventListener (GdomeNode *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_n_dispatchEvent (GdomeNode *self, GdomeEvent *evt, GdomeException *exc); void gdome_n_subTreeDispatchEvent (GdomeNode *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_n_canAppend (GdomeNode *self, GdomeNode *newChild, GdomeException *exc); /* --------------------------- Element --------------------------- */ GdomeDOMString * gdome_el_tagName (GdomeElement *self, GdomeException *exc); GdomeDOMString * gdome_el_getAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); void gdome_el_setAttribute (GdomeElement *self, GdomeDOMString *name, GdomeDOMString *value, GdomeException *exc); void gdome_el_removeAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); GdomeAttr * gdome_el_getAttributeNode (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); GdomeAttr * gdome_el_setAttributeNode (GdomeElement *self, GdomeAttr *newAttr, GdomeException *exc); GdomeAttr * gdome_el_removeAttributeNode (GdomeElement *self, GdomeAttr *oldAttr, GdomeException *exc); GdomeNodeList * gdome_el_getElementsByTagName (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); /* DOM2 interfaces */ GdomeDOMString * gdome_el_getAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); void gdome_el_setAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeDOMString *value, GdomeException *exc); void gdome_el_removeAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeAttr * gdome_el_getAttributeNodeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeAttr * gdome_el_setAttributeNodeNS (GdomeElement *self, GdomeAttr *newAttr, GdomeException *exc); GdomeNodeList * gdome_el_getElementsByTagNameNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeBoolean gdome_el_hasAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); GdomeBoolean gdome_el_hasAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); /* Node inherited interfaces. */ void gdome_el_ref (GdomeElement *self, GdomeException *exc); void gdome_el_unref (GdomeElement *self, GdomeException *exc); gpointer gdome_el_query_interface (GdomeElement *self, const char *interface, GdomeException *exc); GdomeDOMString * gdome_el_nodeName (GdomeElement *self, GdomeException *exc); GdomeDOMString * gdome_el_nodeValue (GdomeElement *self, GdomeException *exc); void gdome_el_set_nodeValue (GdomeElement *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_el_nodeType (GdomeElement *self, GdomeException *exc); GdomeNode * gdome_el_parentNode (GdomeElement *self, GdomeException *exc); GdomeNodeList * gdome_el_childNodes (GdomeElement *self, GdomeException *exc); GdomeNode * gdome_el_firstChild (GdomeElement *self, GdomeException *exc); GdomeNode * gdome_el_lastChild (GdomeElement *self, GdomeException *exc); GdomeNode * gdome_el_previousSibling (GdomeElement *self, GdomeException *exc); GdomeNode * gdome_el_nextSibling (GdomeElement *self, GdomeException *exc); GdomeNamedNodeMap * gdome_el_attributes (GdomeElement *self, GdomeException *exc); GdomeDocument * gdome_el_ownerDocument (GdomeElement *self, GdomeException *exc); GdomeNode * gdome_el_insertBefore (GdomeElement *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode * gdome_el_replaceChild (GdomeElement *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode * gdome_el_removeChild (GdomeElement *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode * gdome_el_appendChild (GdomeElement *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_el_hasChildNodes (GdomeElement *self, GdomeException *exc); GdomeNode * gdome_el_cloneNode (GdomeElement *self, GdomeBoolean deep, GdomeException *exc); void gdome_el_normalize (GdomeElement *self, GdomeException *exc); GdomeBoolean gdome_el_isSupported (GdomeElement *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString * gdome_el_namespaceURI (GdomeElement *self, GdomeException *exc); GdomeDOMString * gdome_el_prefix (GdomeElement *self, GdomeException *exc); void gdome_el_set_prefix (GdomeElement *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString * gdome_el_localName (GdomeElement *self, GdomeException *exc); GdomeBoolean gdome_el_hasAttributes (GdomeElement *self, GdomeException *exc); void gdome_el_addEventListener (GdomeElement *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_el_removeEventListener (GdomeElement *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_el_dispatchEvent (GdomeElement *self, GdomeEvent *evt, GdomeException *exc); void gdome_el_subTreeDispatchEvent (GdomeElement *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_el_canAppend (GdomeElement *self, GdomeNode *newChild, GdomeException *exc); /* --------------------------- Attr --------------------------- */ void gdome_a_ref (GdomeAttr *self, GdomeException *exc); void gdome_a_unref (GdomeAttr *self, GdomeException *exc); gpointer gdome_a_query_interface (GdomeAttr *self, const char *interface, GdomeException *exc); GdomeDOMString * gdome_a_name (GdomeAttr *self, GdomeException *exc); GdomeElement * gdome_a_ownerElement (GdomeAttr *self, GdomeException *exc); GdomeBoolean gdome_a_specified (GdomeAttr *self, GdomeException *exc); GdomeDOMString * gdome_a_value (GdomeAttr *self, GdomeException *exc); void gdome_a_set_value (GdomeAttr *self, GdomeDOMString *value, GdomeException *exc); GdomeDOMString * gdome_a_nodeName (GdomeAttr *self, GdomeException *exc); GdomeDOMString * gdome_a_nodeValue (GdomeAttr *self, GdomeException *exc); void gdome_a_set_nodeValue (GdomeAttr *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_a_nodeType (GdomeAttr *self, GdomeException *exc); GdomeNode * gdome_a_parentNode (GdomeAttr *self, GdomeException *exc); GdomeNodeList * gdome_a_childNodes (GdomeAttr *self, GdomeException *exc); GdomeNode * gdome_a_firstChild (GdomeAttr *self, GdomeException *exc); GdomeNode * gdome_a_lastChild (GdomeAttr *self, GdomeException *exc); GdomeNode * gdome_a_previousSibling (GdomeAttr *self, GdomeException *exc); GdomeNode * gdome_a_nextSibling (GdomeAttr *self, GdomeException *exc); GdomeNamedNodeMap * gdome_a_attributes (GdomeAttr *self, GdomeException *exc); GdomeDocument * gdome_a_ownerDocument (GdomeAttr *self, GdomeException *exc); GdomeNode * gdome_a_insertBefore (GdomeAttr *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode * gdome_a_replaceChild (GdomeAttr *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode * gdome_a_removeChild (GdomeAttr *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode * gdome_a_appendChild (GdomeAttr *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_a_hasChildNodes (GdomeAttr *self, GdomeException *exc); GdomeNode * gdome_a_cloneNode (GdomeAttr *self, GdomeBoolean deep, GdomeException *exc); void gdome_a_normalize (GdomeAttr *self, GdomeException *exc); GdomeBoolean gdome_a_isSupported (GdomeAttr *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString * gdome_a_namespaceURI (GdomeAttr *self, GdomeException *exc); GdomeDOMString * gdome_a_prefix (GdomeAttr *self, GdomeException *exc); void gdome_a_set_prefix (GdomeAttr *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString * gdome_a_localName (GdomeAttr *self, GdomeException *exc); GdomeBoolean gdome_a_hasAttributes (GdomeAttr *self, GdomeException *exc); void gdome_a_addEventListener (GdomeAttr *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_a_removeEventListener (GdomeAttr *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_a_dispatchEvent (GdomeAttr *self, GdomeEvent *evt, GdomeException *exc); void gdome_a_subTreeDispatchEvent (GdomeAttr *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_a_canAppend (GdomeAttr *self, GdomeNode *newChild, GdomeException *exc); GdomeDOMString *gdome_cd_data (GdomeCharacterData *self, GdomeException *exc); void gdome_cd_set_data (GdomeCharacterData *self, GdomeDOMString *data, GdomeException *exc); gulong gdome_cd_length (GdomeCharacterData *self, GdomeException *exc); GdomeDOMString *gdome_cd_substringData (GdomeCharacterData *self, gulong offset, gulong count, GdomeException *exc); void gdome_cd_appendData (GdomeCharacterData *self, GdomeDOMString *arg, GdomeException *exc); void gdome_cd_insertData (GdomeCharacterData *self, gulong offset, GdomeDOMString *arg, GdomeException *exc); void gdome_cd_deleteData (GdomeCharacterData *self, gulong offset, gulong count, GdomeException *exc); void gdome_cd_replaceData (GdomeCharacterData *self, gulong offset, gulong count, GdomeDOMString *arg, GdomeException *exc); void gdome_cd_ref (GdomeCharacterData *self, GdomeException *exc); void gdome_cd_unref (GdomeCharacterData *self, GdomeException *exc); gpointer gdome_cd_query_interface (GdomeCharacterData *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_cd_nodeName (GdomeCharacterData *self, GdomeException *exc); GdomeDOMString *gdome_cd_nodeValue (GdomeCharacterData *self, GdomeException *exc); void gdome_cd_set_nodeValue (GdomeCharacterData *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_cd_nodeType (GdomeCharacterData *self, GdomeException *exc); GdomeNode *gdome_cd_parentNode (GdomeCharacterData *self, GdomeException *exc); GdomeNodeList *gdome_cd_childNodes (GdomeCharacterData *self, GdomeException *exc); GdomeNode *gdome_cd_firstChild (GdomeCharacterData *self, GdomeException *exc); GdomeNode *gdome_cd_lastChild (GdomeCharacterData *self, GdomeException *exc); GdomeNode *gdome_cd_previousSibling (GdomeCharacterData *self, GdomeException *exc); GdomeNode *gdome_cd_nextSibling (GdomeCharacterData *self, GdomeException *exc); GdomeNamedNodeMap *gdome_cd_attributes (GdomeCharacterData *self, GdomeException *exc); GdomeDocument *gdome_cd_ownerDocument (GdomeCharacterData *self, GdomeException *exc); GdomeNode *gdome_cd_insertBefore (GdomeCharacterData *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode *gdome_cd_replaceChild (GdomeCharacterData *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_cd_removeChild (GdomeCharacterData *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_cd_appendChild (GdomeCharacterData *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_cd_hasChildNodes (GdomeCharacterData *self, GdomeException *exc); GdomeNode *gdome_cd_cloneNode (GdomeCharacterData *self, GdomeBoolean deep, GdomeException *exc); void gdome_cd_normalize (GdomeCharacterData *self, GdomeException *exc); GdomeBoolean gdome_cd_isSupported (GdomeCharacterData *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString *gdome_cd_namespaceURI (GdomeCharacterData *self, GdomeException *exc); GdomeDOMString *gdome_cd_prefix (GdomeCharacterData *self, GdomeException *exc); void gdome_cd_set_prefix (GdomeCharacterData *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString *gdome_cd_localName (GdomeCharacterData *self, GdomeException *exc); GdomeBoolean gdome_cd_hasAttributes (GdomeCharacterData *self, GdomeException *exc); void gdome_cd_addEventListener (GdomeCharacterData *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_cd_removeEventListener (GdomeCharacterData *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_cd_dispatchEvent (GdomeCharacterData *self, GdomeEvent *evt, GdomeException *exc); void gdome_cd_subTreeDispatchEvent (GdomeCharacterData *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_cd_canAppend (GdomeCharacterData *self, GdomeNode *newChild, GdomeException *exc); GdomeText *gdome_t_splitText (GdomeText *self, gulong offset, GdomeException *exc); GdomeDOMString *gdome_t_data (GdomeText *self, GdomeException *exc); void gdome_t_set_data (GdomeText *self, GdomeDOMString *data, GdomeException *exc); gulong gdome_t_length (GdomeText *self, GdomeException *exc); GdomeDOMString *gdome_t_substringData (GdomeText *self, gulong offset, gulong count, GdomeException *exc); void gdome_t_appendData (GdomeText *self, GdomeDOMString *arg, GdomeException *exc); void gdome_t_insertData (GdomeText *self, gulong offset, GdomeDOMString *arg, GdomeException *exc); void gdome_t_deleteData (GdomeText *self, gulong offset, gulong count, GdomeException *exc); void gdome_t_replaceData (GdomeText *self, gulong offset, gulong count, GdomeDOMString *arg, GdomeException *exc); void gdome_t_ref (GdomeText *self, GdomeException *exc); void gdome_t_unref (GdomeText *self, GdomeException *exc); gpointer gdome_t_query_interface (GdomeText *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_t_nodeName (GdomeText *self, GdomeException *exc); GdomeDOMString *gdome_t_nodeValue (GdomeText *self, GdomeException *exc); void gdome_t_set_nodeValue (GdomeText *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_t_nodeType (GdomeText *self, GdomeException *exc); GdomeNode *gdome_t_parentNode (GdomeText *self, GdomeException *exc); GdomeNodeList *gdome_t_childNodes (GdomeText *self, GdomeException *exc); GdomeNode *gdome_t_firstChild (GdomeText *self, GdomeException *exc); GdomeNode *gdome_t_lastChild (GdomeText *self, GdomeException *exc); GdomeNode *gdome_t_previousSibling (GdomeText *self, GdomeException *exc); GdomeNode *gdome_t_nextSibling (GdomeText *self, GdomeException *exc); GdomeNamedNodeMap *gdome_t_attributes (GdomeText *self, GdomeException *exc); GdomeDocument *gdome_t_ownerDocument (GdomeText *self, GdomeException *exc); GdomeNode *gdome_t_insertBefore (GdomeText *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode *gdome_t_replaceChild (GdomeText *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_t_removeChild (GdomeText *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_t_appendChild (GdomeText *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_t_hasChildNodes (GdomeText *self, GdomeException *exc); GdomeNode *gdome_t_cloneNode (GdomeText *self, GdomeBoolean deep, GdomeException *exc); void gdome_t_normalize (GdomeText *self, GdomeException *exc); GdomeBoolean gdome_t_isSupported (GdomeText *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString *gdome_t_namespaceURI (GdomeText *self, GdomeException *exc); GdomeDOMString *gdome_t_prefix (GdomeText *self, GdomeException *exc); void gdome_t_set_prefix (GdomeText *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString *gdome_t_localName (GdomeText *self, GdomeException *exc); GdomeBoolean gdome_t_hasAttributes (GdomeText *self, GdomeException *exc); void gdome_t_addEventListener (GdomeText *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_t_removeEventListener (GdomeText *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_t_dispatchEvent (GdomeText *self, GdomeEvent *evt, GdomeException *exc); void gdome_t_subTreeDispatchEvent (GdomeText *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_t_canAppend (GdomeText *self, GdomeNode *newChild, GdomeException *exc); GdomeText *gdome_cds_splitText (GdomeCDATASection *self, gulong offset, GdomeException *exc); GdomeDOMString *gdome_cds_data (GdomeCDATASection *self, GdomeException *exc); void gdome_cds_set_data (GdomeCDATASection *self, GdomeDOMString *data, GdomeException *exc); gulong gdome_cds_length (GdomeCDATASection *self, GdomeException *exc); GdomeDOMString *gdome_cds_substringData (GdomeCDATASection *self, gulong offset, gulong count, GdomeException *exc); void gdome_cds_appendData (GdomeCDATASection *self, GdomeDOMString *arg, GdomeException *exc); void gdome_cds_insertData (GdomeCDATASection *self, gulong offset, GdomeDOMString *arg, GdomeException *exc); void gdome_cds_deleteData (GdomeCDATASection *self, gulong offset, gulong count, GdomeException *exc); void gdome_cds_replaceData (GdomeCDATASection *self, gulong offset, gulong count, GdomeDOMString *arg, GdomeException *exc); void gdome_cds_ref (GdomeCDATASection *self, GdomeException *exc); void gdome_cds_unref (GdomeCDATASection *self, GdomeException *exc); gpointer gdome_cds_query_interface (GdomeCDATASection *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_cds_nodeName (GdomeCDATASection *self, GdomeException *exc); GdomeDOMString *gdome_cds_nodeValue (GdomeCDATASection *self, GdomeException *exc); void gdome_cds_set_nodeValue (GdomeCDATASection *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_cds_nodeType (GdomeCDATASection *self, GdomeException *exc); GdomeNode *gdome_cds_parentNode (GdomeCDATASection *self, GdomeException *exc); GdomeNodeList *gdome_cds_childNodes (GdomeCDATASection *self, GdomeException *exc); GdomeNode *gdome_cds_firstChild (GdomeCDATASection *self, GdomeException *exc); GdomeNode *gdome_cds_lastChild (GdomeCDATASection *self, GdomeException *exc); GdomeNode *gdome_cds_previousSibling (GdomeCDATASection *self, GdomeException *exc); GdomeNode *gdome_cds_nextSibling (GdomeCDATASection *self, GdomeException *exc); GdomeNamedNodeMap *gdome_cds_attributes (GdomeCDATASection *self, GdomeException *exc); GdomeDocument *gdome_cds_ownerDocument (GdomeCDATASection *self, GdomeException *exc); GdomeNode *gdome_cds_insertBefore (GdomeCDATASection *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode *gdome_cds_replaceChild (GdomeCDATASection *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_cds_removeChild (GdomeCDATASection *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_cds_appendChild (GdomeCDATASection *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_cds_hasChildNodes (GdomeCDATASection *self, GdomeException *exc); GdomeNode *gdome_cds_cloneNode (GdomeCDATASection *self, GdomeBoolean deep, GdomeException *exc); void gdome_cds_normalize (GdomeCDATASection *self, GdomeException *exc); GdomeBoolean gdome_cds_isSupported (GdomeCDATASection *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString *gdome_cds_namespaceURI (GdomeCDATASection *self, GdomeException *exc); GdomeDOMString *gdome_cds_prefix (GdomeCDATASection *self, GdomeException *exc); void gdome_cds_set_prefix (GdomeCDATASection *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString *gdome_cds_localName (GdomeCDATASection *self, GdomeException *exc); GdomeBoolean gdome_cds_hasAttributes (GdomeCDATASection *self, GdomeException *exc); void gdome_cds_addEventListener (GdomeCDATASection *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_cds_removeEventListener (GdomeCDATASection *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_cds_dispatchEvent (GdomeCDATASection *self, GdomeEvent *evt, GdomeException *exc); void gdome_cds_subTreeDispatchEvent (GdomeCDATASection *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_cds_canAppend (GdomeCDATASection *self, GdomeNode *newChild, GdomeException *exc); GdomeDOMString *gdome_c_data (GdomeComment *self, GdomeException *exc); void gdome_c_set_data (GdomeComment *self, GdomeDOMString *data, GdomeException *exc); gulong gdome_c_length (GdomeComment *self, GdomeException *exc); GdomeDOMString *gdome_c_substringData (GdomeComment *self, gulong offset, gulong count, GdomeException *exc); void gdome_c_appendData (GdomeComment *self, GdomeDOMString *arg, GdomeException *exc); void gdome_c_insertData (GdomeComment *self, gulong offset, GdomeDOMString *arg, GdomeException *exc); void gdome_c_deleteData (GdomeComment *self, gulong offset, gulong count, GdomeException *exc); void gdome_c_replaceData (GdomeComment *self, gulong offset, gulong count, GdomeDOMString *arg, GdomeException *exc); void gdome_c_ref (GdomeComment *self, GdomeException *exc); void gdome_c_unref (GdomeComment *self, GdomeException *exc); gpointer gdome_c_query_interface (GdomeComment *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_c_nodeName (GdomeComment *self, GdomeException *exc); GdomeDOMString *gdome_c_nodeValue (GdomeComment *self, GdomeException *exc); void gdome_c_set_nodeValue (GdomeComment *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_c_nodeType (GdomeComment *self, GdomeException *exc); GdomeNode *gdome_c_parentNode (GdomeComment *self, GdomeException *exc); GdomeNodeList *gdome_c_childNodes (GdomeComment *self, GdomeException *exc); GdomeNode *gdome_c_firstChild (GdomeComment *self, GdomeException *exc); GdomeNode *gdome_c_lastChild (GdomeComment *self, GdomeException *exc); GdomeNode *gdome_c_previousSibling (GdomeComment *self, GdomeException *exc); GdomeNode *gdome_c_nextSibling (GdomeComment *self, GdomeException *exc); GdomeNamedNodeMap *gdome_c_attributes (GdomeComment *self, GdomeException *exc); GdomeDocument *gdome_c_ownerDocument (GdomeComment *self, GdomeException *exc); GdomeNode *gdome_c_insertBefore (GdomeComment *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode *gdome_c_replaceChild (GdomeComment *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_c_removeChild (GdomeComment *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_c_appendChild (GdomeComment *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_c_hasChildNodes (GdomeComment *self, GdomeException *exc); GdomeNode *gdome_c_cloneNode (GdomeComment *self, GdomeBoolean deep, GdomeException *exc); void gdome_c_normalize (GdomeComment *self, GdomeException *exc); GdomeBoolean gdome_c_isSupported (GdomeComment *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString *gdome_c_namespaceURI (GdomeComment *self, GdomeException *exc); GdomeDOMString *gdome_c_prefix (GdomeComment *self, GdomeException *exc); void gdome_c_set_prefix (GdomeComment *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString *gdome_c_localName (GdomeComment *self, GdomeException *exc); GdomeBoolean gdome_c_hasAttributes (GdomeComment *self, GdomeException *exc); void gdome_c_addEventListener (GdomeComment *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_c_removeEventListener (GdomeComment *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_c_dispatchEvent (GdomeComment *self, GdomeEvent *evt, GdomeException *exc); void gdome_c_subTreeDispatchEvent (GdomeComment *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_c_canAppend (GdomeComment *self, GdomeNode *newChild, GdomeException *exc); GdomeDOMImplementation * gdome_di_mkref (void); void gdome_di_ref (GdomeDOMImplementation *self, GdomeException *exc); void gdome_di_unref (GdomeDOMImplementation *self, GdomeException *exc); gpointer gdome_di_query_interface (GdomeDOMImplementation *self, const char *interface, GdomeException *exc); GdomeBoolean gdome_di_hasFeature (GdomeDOMImplementation *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDocumentType *gdome_di_createDocumentType (GdomeDOMImplementation *self, GdomeDOMString *qualifiedName, GdomeDOMString *publicId, GdomeDOMString *systemId, GdomeException *exc); GdomeDocument *gdome_di_createDocument (GdomeDOMImplementation *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeDocumentType *doctype, GdomeException *exc); void gdome_di_freeDoc (GdomeDOMImplementation *self, GdomeDocument *doc, GdomeException *exc); GdomeDocument *gdome_di_createDocFromURI (GdomeDOMImplementation *self, const char *uri, unsigned int mode, GdomeException *exc); GdomeDocument *gdome_di_createDocFromMemory (GdomeDOMImplementation *self, char *buffer, unsigned int mode, GdomeException *exc); GdomeDocument *gdome_di_createDocFromURIWithEntitiesTable (GdomeDOMImplementation *self, const char *uri, const GdomeEntitiesTableEntry entityTable[], unsigned int mode, GdomeException *exc); GdomeDocument *gdome_di_createDocFromMemoryWithEntitiesTable (GdomeDOMImplementation *self, char *buffer, const GdomeEntitiesTableEntry entityTable[], unsigned int mode, GdomeException *exc); GdomeBoolean gdome_di_saveDocToFile (GdomeDOMImplementation *self, GdomeDocument *doc, const char *filename, GdomeSavingCode mode, GdomeException *exc); GdomeBoolean gdome_di_saveDocToFileEnc (GdomeDOMImplementation *self, GdomeDocument *doc, const char *filename, const char *encoding, GdomeSavingCode mode, GdomeException *exc); GdomeBoolean gdome_di_saveDocToMemory (GdomeDOMImplementation *self, GdomeDocument *doc, char **mem, GdomeSavingCode mode, GdomeException *exc); GdomeBoolean gdome_di_saveDocToMemoryEnc (GdomeDOMImplementation *self, GdomeDocument *doc, char **mem, const char *encoding, GdomeSavingCode mode, GdomeException *exc); void gdome_di_enableEvent (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc); void gdome_di_disableEvent (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc); GdomeBoolean gdome_di_eventIsEnabled (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc); GdomeDocumentType *gdome_doc_doctype (GdomeDocument *self, GdomeException *exc); GdomeDOMImplementation *gdome_doc_implementation (GdomeDocument *self, GdomeException *exc); GdomeElement *gdome_doc_documentElement (GdomeDocument *self, GdomeException *exc); GdomeElement *gdome_doc_createElement (GdomeDocument *self, GdomeDOMString *tagName, GdomeException *exc); GdomeDocumentFragment *gdome_doc_createDocumentFragment (GdomeDocument *self, GdomeException *exc); GdomeText *gdome_doc_createTextNode (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc); GdomeComment *gdome_doc_createComment (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc); GdomeCDATASection *gdome_doc_createCDATASection (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc); GdomeProcessingInstruction *gdome_doc_createProcessingInstruction (GdomeDocument *self, GdomeDOMString *target, GdomeDOMString *data, GdomeException *exc); GdomeAttr *gdome_doc_createAttribute (GdomeDocument *self, GdomeDOMString *name, GdomeException *exc); GdomeEntityReference *gdome_doc_createEntityReference (GdomeDocument *self, GdomeDOMString *name, GdomeException *exc); GdomeNodeList *gdome_doc_getElementsByTagName (GdomeDocument *self, GdomeDOMString *tagname, GdomeException *exc); GdomeNode *gdome_doc_importNode (GdomeDocument *self, GdomeNode *importedNode, GdomeBoolean deep, GdomeException *exc); GdomeElement *gdome_doc_createElementNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); GdomeAttr *gdome_doc_createAttributeNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); GdomeNodeList *gdome_doc_getElementsByTagNameNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeElement *gdome_doc_getElementById (GdomeDocument *self, GdomeDOMString *elementId, GdomeException *exc); GdomeEvent *gdome_doc_createEvent (GdomeDocument *self, GdomeDOMString *eventType, GdomeException *exc); void gdome_doc_ref (GdomeDocument *self, GdomeException *exc); void gdome_doc_unref (GdomeDocument *self, GdomeException *exc); gpointer gdome_doc_query_interface (GdomeDocument *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_doc_nodeName (GdomeDocument *self, GdomeException *exc); GdomeDOMString *gdome_doc_nodeValue (GdomeDocument *self, GdomeException *exc); void gdome_doc_set_nodeValue (GdomeDocument *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_doc_nodeType (GdomeDocument *self, GdomeException *exc); GdomeNode *gdome_doc_parentNode (GdomeDocument *self, GdomeException *exc); GdomeNodeList *gdome_doc_childNodes (GdomeDocument *self, GdomeException *exc); GdomeNode *gdome_doc_firstChild (GdomeDocument *self, GdomeException *exc); GdomeNode *gdome_doc_lastChild (GdomeDocument *self, GdomeException *exc); GdomeNode *gdome_doc_previousSibling (GdomeDocument *self, GdomeException *exc); GdomeNode *gdome_doc_nextSibling (GdomeDocument *self, GdomeException *exc); GdomeNamedNodeMap *gdome_doc_attributes (GdomeDocument *self, GdomeException *exc); GdomeDocument *gdome_doc_ownerDocument (GdomeDocument *self, GdomeException *exc); GdomeNode *gdome_doc_insertBefore (GdomeDocument *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode *gdome_doc_replaceChild (GdomeDocument *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_doc_removeChild (GdomeDocument *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_doc_appendChild (GdomeDocument *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_doc_hasChildNodes (GdomeDocument *self, GdomeException *exc); GdomeNode *gdome_doc_cloneNode (GdomeDocument *self, GdomeBoolean deep, GdomeException *exc); void gdome_doc_normalize (GdomeDocument *self, GdomeException *exc); GdomeBoolean gdome_doc_isSupported (GdomeDocument *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString *gdome_doc_namespaceURI (GdomeDocument *self, GdomeException *exc); GdomeDOMString *gdome_doc_prefix (GdomeDocument *self, GdomeException *exc); void gdome_doc_set_prefix (GdomeDocument *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString *gdome_doc_localName (GdomeDocument *self, GdomeException *exc); GdomeBoolean gdome_doc_hasAttributes (GdomeDocument *self, GdomeException *exc); void gdome_doc_addEventListener (GdomeDocument *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_doc_removeEventListener (GdomeDocument *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_doc_dispatchEvent (GdomeDocument *self, GdomeEvent *evt, GdomeException *exc); void gdome_doc_subTreeDispatchEvent (GdomeDocument *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_doc_canAppend (GdomeDocument *self, GdomeNode *newChild, GdomeException *exc); void gdome_df_ref (GdomeDocumentFragment *self, GdomeException *exc); void gdome_df_unref (GdomeDocumentFragment *self, GdomeException *exc); gpointer gdome_df_query_interface (GdomeDocumentFragment *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_df_nodeName (GdomeDocumentFragment *self, GdomeException *exc); GdomeDOMString *gdome_df_nodeValue (GdomeDocumentFragment *self, GdomeException *exc); void gdome_df_set_nodeValue (GdomeDocumentFragment *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_df_nodeType (GdomeDocumentFragment *self, GdomeException *exc); GdomeNode *gdome_df_parentNode (GdomeDocumentFragment *self, GdomeException *exc); GdomeNodeList *gdome_df_childNodes (GdomeDocumentFragment *self, GdomeException *exc); GdomeNode *gdome_df_firstChild (GdomeDocumentFragment *self, GdomeException *exc); GdomeNode *gdome_df_lastChild (GdomeDocumentFragment *self, GdomeException *exc); GdomeNode *gdome_df_previousSibling (GdomeDocumentFragment *self, GdomeException *exc); GdomeNode *gdome_df_nextSibling (GdomeDocumentFragment *self, GdomeException *exc); GdomeNamedNodeMap *gdome_df_attributes (GdomeDocumentFragment *self, GdomeException *exc); GdomeDocument *gdome_df_ownerDocument (GdomeDocumentFragment *self, GdomeException *exc); GdomeNode *gdome_df_insertBefore (GdomeDocumentFragment *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode *gdome_df_replaceChild (GdomeDocumentFragment *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_df_removeChild (GdomeDocumentFragment *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_df_appendChild (GdomeDocumentFragment *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_df_hasChildNodes (GdomeDocumentFragment *self, GdomeException *exc); GdomeNode *gdome_df_cloneNode (GdomeDocumentFragment *self, GdomeBoolean deep, GdomeException *exc); void gdome_df_normalize (GdomeDocumentFragment *self, GdomeException *exc); GdomeBoolean gdome_df_isSupported (GdomeDocumentFragment *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString *gdome_df_namespaceURI (GdomeDocumentFragment *self, GdomeException *exc); GdomeDOMString *gdome_df_prefix (GdomeDocumentFragment *self, GdomeException *exc); void gdome_df_set_prefix (GdomeDocumentFragment *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString *gdome_df_localName (GdomeDocumentFragment *self, GdomeException *exc); GdomeBoolean gdome_df_hasAttributes (GdomeDocumentFragment *self, GdomeException *exc); void gdome_df_addEventListener (GdomeDocumentFragment *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_df_removeEventListener (GdomeDocumentFragment *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_df_dispatchEvent (GdomeDocumentFragment *self, GdomeEvent *evt, GdomeException *exc); void gdome_df_subTreeDispatchEvent (GdomeDocumentFragment *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_df_canAppend (GdomeDocumentFragment *self, GdomeNode *newChild, GdomeException *exc); GdomeDOMString *gdome_dt_name (GdomeDocumentType *self, GdomeException *exc); GdomeNamedNodeMap *gdome_dt_entities (GdomeDocumentType *self, GdomeException *exc); GdomeNamedNodeMap *gdome_dt_notations (GdomeDocumentType *self, GdomeException *exc); GdomeDOMString *gdome_dt_publicId (GdomeDocumentType *self, GdomeException *exc); GdomeDOMString *gdome_dt_systemId (GdomeDocumentType *self, GdomeException *exc); GdomeDOMString *gdome_dt_internalSubset (GdomeDocumentType *self, GdomeException *exc); void gdome_dt_ref (GdomeDocumentType *self, GdomeException *exc); void gdome_dt_unref (GdomeDocumentType *self, GdomeException *exc); gpointer gdome_dt_query_interface (GdomeDocumentType *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_dt_nodeName (GdomeDocumentType *self, GdomeException *exc); GdomeDOMString *gdome_dt_nodeValue (GdomeDocumentType *self, GdomeException *exc); void gdome_dt_set_nodeValue (GdomeDocumentType *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_dt_nodeType (GdomeDocumentType *self, GdomeException *exc); GdomeNode *gdome_dt_parentNode (GdomeDocumentType *self, GdomeException *exc); GdomeNodeList *gdome_dt_childNodes (GdomeDocumentType *self, GdomeException *exc); GdomeNode *gdome_dt_firstChild (GdomeDocumentType *self, GdomeException *exc); GdomeNode *gdome_dt_lastChild (GdomeDocumentType *self, GdomeException *exc); GdomeNode *gdome_dt_previousSibling (GdomeDocumentType *self, GdomeException *exc); GdomeNode *gdome_dt_nextSibling (GdomeDocumentType *self, GdomeException *exc); GdomeNamedNodeMap *gdome_dt_attributes (GdomeDocumentType *self, GdomeException *exc); GdomeDocument *gdome_dt_ownerDocument (GdomeDocumentType *self, GdomeException *exc); GdomeNode *gdome_dt_insertBefore (GdomeDocumentType *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode *gdome_dt_replaceChild (GdomeDocumentType *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_dt_removeChild (GdomeDocumentType *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_dt_appendChild (GdomeDocumentType *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_dt_hasChildNodes (GdomeDocumentType *self, GdomeException *exc); GdomeNode *gdome_dt_cloneNode (GdomeDocumentType *self, GdomeBoolean deep, GdomeException *exc); void gdome_dt_normalize (GdomeDocumentType *self, GdomeException *exc); GdomeBoolean gdome_dt_isSupported (GdomeDocumentType *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString *gdome_dt_namespaceURI (GdomeDocumentType *self, GdomeException *exc); GdomeDOMString *gdome_dt_prefix (GdomeDocumentType *self, GdomeException *exc); void gdome_dt_set_prefix (GdomeDocumentType *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString *gdome_dt_localName (GdomeDocumentType *self, GdomeException *exc); GdomeBoolean gdome_dt_hasAttributes (GdomeDocumentType *self, GdomeException *exc); void gdome_dt_addEventListener (GdomeDocumentType *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_dt_removeEventListener (GdomeDocumentType *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_dt_dispatchEvent (GdomeDocumentType *self, GdomeEvent *evt, GdomeException *exc); void gdome_dt_subTreeDispatchEvent (GdomeDocumentType *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_dt_canAppend (GdomeDocumentType *self, GdomeNode *newChild, GdomeException *exc); GdomeDOMString *gdome_ent_publicId (GdomeEntity *self, GdomeException *exc); GdomeDOMString *gdome_ent_systemId (GdomeEntity *self, GdomeException *exc); GdomeDOMString *gdome_ent_notationName (GdomeEntity *self, GdomeException *exc); void gdome_ent_ref (GdomeEntity *self, GdomeException *exc); void gdome_ent_unref (GdomeEntity *self, GdomeException *exc); gpointer gdome_ent_query_interface (GdomeEntity *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_ent_nodeName (GdomeEntity *self, GdomeException *exc); GdomeDOMString *gdome_ent_nodeValue (GdomeEntity *self, GdomeException *exc); void gdome_ent_set_nodeValue (GdomeEntity *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_ent_nodeType (GdomeEntity *self, GdomeException *exc); GdomeNode *gdome_ent_parentNode (GdomeEntity *self, GdomeException *exc); GdomeNodeList *gdome_ent_childNodes (GdomeEntity *self, GdomeException *exc); GdomeNode *gdome_ent_firstChild (GdomeEntity *self, GdomeException *exc); GdomeNode *gdome_ent_lastChild (GdomeEntity *self, GdomeException *exc); GdomeNode *gdome_ent_previousSibling (GdomeEntity *self, GdomeException *exc); GdomeNode *gdome_ent_nextSibling (GdomeEntity *self, GdomeException *exc); GdomeNamedNodeMap *gdome_ent_attributes (GdomeEntity *self, GdomeException *exc); GdomeDocument *gdome_ent_ownerDocument (GdomeEntity *self, GdomeException *exc); GdomeNode *gdome_ent_insertBefore (GdomeEntity *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode *gdome_ent_replaceChild (GdomeEntity *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_ent_removeChild (GdomeEntity *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_ent_appendChild (GdomeEntity *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_ent_hasChildNodes (GdomeEntity *self, GdomeException *exc); GdomeNode *gdome_ent_cloneNode (GdomeEntity *self, GdomeBoolean deep, GdomeException *exc); void gdome_ent_normalize (GdomeEntity *self, GdomeException *exc); GdomeBoolean gdome_ent_isSupported (GdomeEntity *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString *gdome_ent_namespaceURI (GdomeEntity *self, GdomeException *exc); GdomeDOMString *gdome_ent_prefix (GdomeEntity *self, GdomeException *exc); void gdome_ent_set_prefix (GdomeEntity *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString *gdome_ent_localName (GdomeEntity *self, GdomeException *exc); GdomeBoolean gdome_ent_hasAttributes (GdomeEntity *self, GdomeException *exc); void gdome_ent_addEventListener (GdomeEntity *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_ent_removeEventListener (GdomeEntity *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_ent_dispatchEvent (GdomeEntity *self, GdomeEvent *evt, GdomeException *exc); void gdome_ent_subTreeDispatchEvent (GdomeEntity *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_ent_canAppend (GdomeEntity *self, GdomeNode *newChild, GdomeException *exc); void gdome_er_ref (GdomeEntityReference *self, GdomeException *exc); void gdome_er_unref (GdomeEntityReference *self, GdomeException *exc); gpointer gdome_er_query_interface (GdomeEntityReference *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_er_nodeName (GdomeEntityReference *self, GdomeException *exc); GdomeDOMString *gdome_er_nodeValue (GdomeEntityReference *self, GdomeException *exc); void gdome_er_set_nodeValue (GdomeEntityReference *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_er_nodeType (GdomeEntityReference *self, GdomeException *exc); GdomeNode *gdome_er_parentNode (GdomeEntityReference *self, GdomeException *exc); GdomeNodeList *gdome_er_childNodes (GdomeEntityReference *self, GdomeException *exc); GdomeNode *gdome_er_firstChild (GdomeEntityReference *self, GdomeException *exc); GdomeNode *gdome_er_lastChild (GdomeEntityReference *self, GdomeException *exc); GdomeNode *gdome_er_previousSibling (GdomeEntityReference *self, GdomeException *exc); GdomeNode *gdome_er_nextSibling (GdomeEntityReference *self, GdomeException *exc); GdomeNamedNodeMap *gdome_er_attributes (GdomeEntityReference *self, GdomeException *exc); GdomeDocument *gdome_er_ownerDocument (GdomeEntityReference *self, GdomeException *exc); GdomeNode *gdome_er_insertBefore (GdomeEntityReference *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode *gdome_er_replaceChild (GdomeEntityReference *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_er_removeChild (GdomeEntityReference *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_er_appendChild (GdomeEntityReference *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_er_hasChildNodes (GdomeEntityReference *self, GdomeException *exc); GdomeNode *gdome_er_cloneNode (GdomeEntityReference *self, GdomeBoolean deep, GdomeException *exc); void gdome_er_normalize (GdomeEntityReference *self, GdomeException *exc); GdomeBoolean gdome_er_isSupported (GdomeEntityReference *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString *gdome_er_namespaceURI (GdomeEntityReference *self, GdomeException *exc); GdomeDOMString *gdome_er_prefix (GdomeEntityReference *self, GdomeException *exc); void gdome_er_set_prefix (GdomeEntityReference *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString *gdome_er_localName (GdomeEntityReference *self, GdomeException *exc); GdomeBoolean gdome_er_hasAttributes (GdomeEntityReference *self, GdomeException *exc); void gdome_er_addEventListener (GdomeEntityReference *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_er_removeEventListener (GdomeEntityReference *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_er_dispatchEvent (GdomeEntityReference *self, GdomeEvent *evt, GdomeException *exc); void gdome_er_subTreeDispatchEvent (GdomeEntityReference *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_er_canAppend (GdomeEntityReference *self, GdomeNode *newChild, GdomeException *exc); void gdome_nnm_ref (GdomeNamedNodeMap *self, GdomeException *exc); void gdome_nnm_unref (GdomeNamedNodeMap *self, GdomeException *exc); gpointer gdome_nnm_query_interface (GdomeNamedNodeMap *self, const char *interface, GdomeException *exc); GdomeNode *gdome_nnm_getNamedItem (GdomeNamedNodeMap *self, GdomeDOMString *name, GdomeException *exc); GdomeNode *gdome_nnm_setNamedItem (GdomeNamedNodeMap *self, GdomeNode *arg, GdomeException *exc); GdomeNode *gdome_nnm_removeNamedItem (GdomeNamedNodeMap *self, GdomeDOMString *name, GdomeException *exc); GdomeNode *gdome_nnm_item (GdomeNamedNodeMap *self, gulong index, GdomeException *exc); gulong gdome_nnm_length (GdomeNamedNodeMap *self, GdomeException *exc); GdomeNode *gdome_nnm_getNamedItemNS (GdomeNamedNodeMap *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeNode *gdome_nnm_setNamedItemNS (GdomeNamedNodeMap *self, GdomeNode *arg, GdomeException *exc); GdomeNode *gdome_nnm_removeNamedItemNS (GdomeNamedNodeMap *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); void gdome_nl_ref (GdomeNodeList *self, GdomeException *exc); void gdome_nl_unref (GdomeNodeList *self, GdomeException *exc); gpointer gdome_nl_query_interface (GdomeNodeList *self, const char *interface, GdomeException *exc); GdomeNode *gdome_nl_item (GdomeNodeList *self, gulong index, GdomeException *exc); gulong gdome_nl_length (GdomeNodeList *self, GdomeException *exc); GdomeDOMString *gdome_not_publicId (GdomeNotation *self, GdomeException *exc); GdomeDOMString *gdome_not_systemId (GdomeNotation *self, GdomeException *exc); void gdome_not_ref (GdomeNotation *self, GdomeException *exc); void gdome_not_unref (GdomeNotation *self, GdomeException *exc); gpointer gdome_not_query_interface (GdomeNotation *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_not_nodeName (GdomeNotation *self, GdomeException *exc); GdomeDOMString *gdome_not_nodeValue (GdomeNotation *self, GdomeException *exc); void gdome_not_set_nodeValue (GdomeNotation *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_not_nodeType (GdomeNotation *self, GdomeException *exc); GdomeNode *gdome_not_parentNode (GdomeNotation *self, GdomeException *exc); GdomeNodeList *gdome_not_childNodes (GdomeNotation *self, GdomeException *exc); GdomeNode *gdome_not_firstChild (GdomeNotation *self, GdomeException *exc); GdomeNode *gdome_not_lastChild (GdomeNotation *self, GdomeException *exc); GdomeNode *gdome_not_previousSibling (GdomeNotation *self, GdomeException *exc); GdomeNode *gdome_not_nextSibling (GdomeNotation *self, GdomeException *exc); GdomeNamedNodeMap *gdome_not_attributes (GdomeNotation *self, GdomeException *exc); GdomeDocument *gdome_not_ownerDocument (GdomeNotation *self, GdomeException *exc); GdomeNode *gdome_not_insertBefore (GdomeNotation *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode *gdome_not_replaceChild (GdomeNotation *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_not_removeChild (GdomeNotation *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_not_appendChild (GdomeNotation *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_not_hasChildNodes (GdomeNotation *self, GdomeException *exc); GdomeNode *gdome_not_cloneNode (GdomeNotation *self, GdomeBoolean deep, GdomeException *exc); void gdome_not_normalize (GdomeNotation *self, GdomeException *exc); GdomeBoolean gdome_not_isSupported (GdomeNotation *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString *gdome_not_namespaceURI (GdomeNotation *self, GdomeException *exc); GdomeDOMString *gdome_not_prefix (GdomeNotation *self, GdomeException *exc); void gdome_not_set_prefix (GdomeNotation *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString *gdome_not_localName (GdomeNotation *self, GdomeException *exc); GdomeBoolean gdome_not_hasAttributes (GdomeNotation *self, GdomeException *exc); void gdome_not_addEventListener (GdomeNotation *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_not_removeEventListener (GdomeNotation *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_not_dispatchEvent (GdomeNotation *self, GdomeEvent *evt, GdomeException *exc); void gdome_not_subTreeDispatchEvent (GdomeNotation *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_not_canAppend (GdomeNotation *self, GdomeNode *newChild, GdomeException *exc); GdomeDOMString *gdome_pi_target (GdomeProcessingInstruction *self, GdomeException *exc); GdomeDOMString *gdome_pi_data (GdomeProcessingInstruction *self, GdomeException *exc); void gdome_pi_set_data (GdomeProcessingInstruction *self, GdomeDOMString *data, GdomeException *exc); void gdome_pi_ref (GdomeProcessingInstruction *self, GdomeException *exc); void gdome_pi_unref (GdomeProcessingInstruction *self, GdomeException *exc); gpointer gdome_pi_query_interface (GdomeProcessingInstruction *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_pi_nodeName (GdomeProcessingInstruction *self, GdomeException *exc); GdomeDOMString *gdome_pi_nodeValue (GdomeProcessingInstruction *self, GdomeException *exc); void gdome_pi_set_nodeValue (GdomeProcessingInstruction *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_pi_nodeType (GdomeProcessingInstruction *self, GdomeException *exc); GdomeNode *gdome_pi_parentNode (GdomeProcessingInstruction *self, GdomeException *exc); GdomeNodeList *gdome_pi_childNodes (GdomeProcessingInstruction *self, GdomeException *exc); GdomeNode *gdome_pi_firstChild (GdomeProcessingInstruction *self, GdomeException *exc); GdomeNode *gdome_pi_lastChild (GdomeProcessingInstruction *self, GdomeException *exc); GdomeNode *gdome_pi_previousSibling (GdomeProcessingInstruction *self, GdomeException *exc); GdomeNode *gdome_pi_nextSibling (GdomeProcessingInstruction *self, GdomeException *exc); GdomeNamedNodeMap *gdome_pi_attributes (GdomeProcessingInstruction *self, GdomeException *exc); GdomeDocument *gdome_pi_ownerDocument (GdomeProcessingInstruction *self, GdomeException *exc); GdomeNode *gdome_pi_insertBefore (GdomeProcessingInstruction *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode *gdome_pi_replaceChild (GdomeProcessingInstruction *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_pi_removeChild (GdomeProcessingInstruction *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode *gdome_pi_appendChild (GdomeProcessingInstruction *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_pi_hasChildNodes (GdomeProcessingInstruction *self, GdomeException *exc); GdomeNode *gdome_pi_cloneNode (GdomeProcessingInstruction *self, GdomeBoolean deep, GdomeException *exc); void gdome_pi_normalize (GdomeProcessingInstruction *self, GdomeException *exc); GdomeBoolean gdome_pi_isSupported (GdomeProcessingInstruction *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString *gdome_pi_namespaceURI (GdomeProcessingInstruction *self, GdomeException *exc); GdomeDOMString *gdome_pi_prefix (GdomeProcessingInstruction *self, GdomeException *exc); void gdome_pi_set_prefix (GdomeProcessingInstruction *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString *gdome_pi_localName (GdomeProcessingInstruction *self, GdomeException *exc); GdomeBoolean gdome_pi_hasAttributes (GdomeProcessingInstruction *self, GdomeException *exc); void gdome_pi_addEventListener (GdomeProcessingInstruction *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_pi_removeEventListener (GdomeProcessingInstruction *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_pi_dispatchEvent (GdomeProcessingInstruction *self, GdomeEvent *evt, GdomeException *exc); void gdome_pi_subTreeDispatchEvent (GdomeProcessingInstruction *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_pi_canAppend (GdomeProcessingInstruction *self, GdomeNode *newChild, GdomeException *exc); GdomeElement * gdome_xpns_ownerElement (GdomeXPathNamespace *self, GdomeException *exc); GdomeDocument * gdome_xpns_ownerDocument (GdomeXPathNamespace *self, GdomeException *exc); GdomeDOMString * gdome_xpns_prefix (GdomeXPathNamespace *self, GdomeException *exc); GdomeDOMString * gdome_xpns_nodeName (GdomeXPathNamespace *self, GdomeException *exc); unsigned short gdome_xpns_nodeType (GdomeXPathNamespace *self, GdomeException *exc); GdomeDOMString * gdome_xpns_namespaceURI (GdomeXPathNamespace *self, GdomeException *exc); /* Casting Macro */ #include /** * GDOME_A: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeAttr one. */ #define GDOME_A(node) gdome_cast_a((GdomeNode *)node) /** * GDOME_CD: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeCharacterData one. */ #define GDOME_CD(node) gdome_cast_cd((GdomeNode *)node) /** * GDOME_CDS: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeCDATASection one. */ #define GDOME_CDS(node) gdome_cast_cds((GdomeNode *)node) /** * GDOME_C: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeComment one. */ #define GDOME_C(node) gdome_cast_c((GdomeNode *)node) /** * GDOME_DOC: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeDocument one. */ #define GDOME_DOC(node) gdome_cast_doc((GdomeNode *)node) /** * GDOME_DF: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeDocumentFragment one. */ #define GDOME_DF(node) gdome_cast_df((GdomeNode *)node) /** * GDOME_DT: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeDocumentType one. */ #define GDOME_DT(node) gdome_cast_dt((GdomeNode *)node) /** * GDOME_EL: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeElement one. */ #define GDOME_EL(node) gdome_cast_el((GdomeNode *)node) /** * GDOME_ENT: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeEntity one. */ #define GDOME_ENT(node) gdome_cast_ent((GdomeNode *)node) /** * GDOME_ER: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeEntityReference one. */ #define GDOME_ER(node) gdome_cast_er((GdomeNode *)node) /** * GDOME_N: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeNode one. */ #define GDOME_N(node) gdome_cast_n((GdomeNode *)node) /** * GDOME_NOT: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeNotation one. */ #define GDOME_NOT(node) gdome_cast_not((GdomeNode *)node) /** * GDOME_PI: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeProcessingInstruction one. */ #define GDOME_PI(node) gdome_cast_pi((GdomeNode *)node) /** * GDOME_T: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeText one. */ #define GDOME_T(node) gdome_cast_t((GdomeNode *)node) /** * GDOME_EVNTT: * @node: Node Object ref * * Cast a ganeral GdomeNode reference to a GdomeEventTarget one. */ #define GDOME_EVNTT(node) gdome_cast_evntt((GdomeNode *)node) /** * GDOME_XMLNS_NAMESPACE: * * This is the namespace for the xmlns: prefix for namespace declaration * attributes. */ #define GDOME_XMLNS_NAMESPACE \ (const xmlChar *) "http://www.w3.org/2000/xmlns/" #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* GDOME_H */ gdome2-0.8.1/libgdome/gdome-events.h0000664000076400007640000001442107625205235012730 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ /* gdome-events.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_EVENTS_H #define GDOME_EVENTS_H #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef enum { GDOME_UNSPECIFIED_EVENT_TYPE_ERR = 0 } GdomeEventExceptionCode; typedef struct _GdomeEventVtab GdomeEventVtab; typedef struct _GdomeEventListenerVtab GdomeEventListenerVtab; typedef struct _GdomeMutationEventVtab GdomeMutationEventVtab; typedef enum { GDOME_BASE_EVENT = 1, GDOME_MUTATION_EVENT = 2, } GdomeEventType; typedef enum { GDOME_CAPTURING_PHASE = 1, GDOME_AT_TARGET = 2, GDOME_BUBBLING_PHASE = 3 } GdomePhaseType; typedef enum { GDOME_ADDITION = 1, GDOME_MODIFICATION = 2, GDOME_REMOVAL = 3 } GdomeAttrChangeType; struct _GdomeEvent { gpointer user_data; }; struct _GdomeEventListener { gpointer user_data; }; struct _GdomeMutationEvent { gpointer user_data; }; GdomeEvent *gdome_evnt_mkref (void); void gdome_evnt_ref (GdomeEvent *self, GdomeException *exc); void gdome_evnt_unref (GdomeEvent *self, GdomeException *exc); gpointer gdome_evnt_query_interface (GdomeEvent *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_evnt_type (GdomeEvent *self, GdomeException *exc); GdomeEventTarget *gdome_evnt_target (GdomeEvent *self, GdomeException *exc); GdomeEventTarget *gdome_evnt_currentTarget (GdomeEvent *self, GdomeException *exc); unsigned short gdome_evnt_eventPhase (GdomeEvent *self, GdomeException *exc); GdomeBoolean gdome_evnt_bubbles (GdomeEvent *self, GdomeException *exc); GdomeBoolean gdome_evnt_cancelable (GdomeEvent *self, GdomeException *exc); GdomeDOMTimeStamp gdome_evnt_timeStamp (GdomeEvent *self, GdomeException *exc); void gdome_evnt_stopPropagation (GdomeEvent *self, GdomeException *exc); void gdome_evnt_preventDefault (GdomeEvent *self, GdomeException *exc); void gdome_evnt_initEvent (GdomeEvent *self, GdomeDOMString *eventTypeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeException *exc); GdomeEventListener *gdome_evntl_aux_mkref (void (*callback) (GdomeEventListener *self, GdomeEvent *event, GdomeException *exc), gpointer priv, void (priv_callback) (GdomeEventListener* self)); GdomeEventListener *gdome_evntl_mkref (void (*callback) (GdomeEventListener *self, GdomeEvent *event, GdomeException *exc), gpointer priv); void gdome_evntl_ref (GdomeEventListener *self, GdomeException *exc); void gdome_evntl_unref (GdomeEventListener *self, GdomeException *exc); gpointer gdome_evntl_query_interface (GdomeEventListener *self, const char *interface, GdomeException *exc); void gdome_evntl_handleEvent (GdomeEventListener *self, GdomeEvent *evt, GdomeException *exc); gpointer gdome_evntl_get_priv (GdomeEventListener *self); GdomeMutationEvent *gdome_mevnt_mkref (void); GdomeNode *gdome_mevnt_relatedNode (GdomeMutationEvent *self, GdomeException *exc); GdomeDOMString *gdome_mevnt_prevValue (GdomeMutationEvent *self, GdomeException *exc); GdomeDOMString *gdome_mevnt_newValue (GdomeMutationEvent *self, GdomeException *exc); GdomeDOMString *gdome_mevnt_attrName (GdomeMutationEvent *self, GdomeException *exc); gushort gdome_mevnt_attrChange (GdomeMutationEvent *self, GdomeException *exc); void gdome_mevnt_initMutationEvent (GdomeMutationEvent *self, GdomeDOMString *typeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeNode *relatedNodeArg, GdomeDOMString *prevValueArg, GdomeDOMString *newValueArg, GdomeDOMString *attrNameArg, gushort attrChangeArg, GdomeException *exc); void gdome_mevnt_ref (GdomeMutationEvent *self, GdomeException *exc); void gdome_mevnt_unref (GdomeMutationEvent *self, GdomeException *exc); gpointer gdome_mevnt_query_interface (GdomeMutationEvent *self, const char *interface, GdomeException *exc); GdomeDOMString *gdome_mevnt_type (GdomeMutationEvent *self, GdomeException *exc); GdomeNode *gdome_mevnt_target (GdomeMutationEvent *self, GdomeException *exc); GdomeNode *gdome_mevnt_currentTarget (GdomeMutationEvent *self, GdomeException *exc); unsigned short gdome_mevnt_eventPhase (GdomeMutationEvent *self, GdomeException *exc); GdomeBoolean gdome_mevnt_bubbles (GdomeMutationEvent *self, GdomeException *exc); GdomeBoolean gdome_mevnt_cancelable (GdomeMutationEvent *self, GdomeException *exc); GdomeDOMTimeStamp gdome_mevnt_timeStamp (GdomeMutationEvent *self, GdomeException *exc); void gdome_mevnt_stopPropagation (GdomeMutationEvent *self, GdomeException *exc); void gdome_mevnt_preventDefault (GdomeMutationEvent *self, GdomeException *exc); void gdome_mevnt_initEvent (GdomeMutationEvent *self, GdomeDOMString *eventTypeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeException *exc); /* Casting Macro */ #include /** * GDOME_EVNT: * @evt: Event Object ref * * Cast a ganeral GdomeEvent reference to a GdomeEvent one. */ #define GDOME_EVNT(evt) gdome_cast_evnt((GdomeEvent *)evt) /** * GDOME_MEVNT: * @evt: Event Object ref * * Cast a ganeral GdomeEvent reference to a GdomeMutationEvent one. */ #define GDOME_MEVNT(evt) gdome_cast_mevnt((GdomeEvent *)evt) #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* GDOME_EVENTS_H */ gdome2-0.8.1/libgdome/gdome-xpath.h0000664000076400007640000000712107437576325012563 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xpath.h * * CopyRight (C) 2002 T.J. Mather * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_XPATH_H #define GDOME_XPATH_H #include #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ /* error types for our xpath exception handling system. */ typedef enum { GDOME_INVALID_EXPRESSION_ERR = 101, GDOME_TYPE_ERR = 102 } GdomeXPathExceptionCode; /* xpath types */ typedef enum { GDOME_ANY_TYPE = 0, GDOME_NUMBER_TYPE = 1, GDOME_STRING_TYPE = 2, GDOME_BOOLEAN_TYPE = 3, GDOME_UNORDERED_NODE_ITERATOR_TYPE = 4, GDOME_ORDERED_NODE_ITERATOR_TYPE = 5, GDOME_UNORDERED_NODE_SNAPSHOT_TYPE = 6, GDOME_ORDERED_NODE_SNAPSHOT_TYPE = 7, GDOME_ANY_UNORDERED_NODE_TYPE = 8, GDOME_FIRST_ORDERED_NODE_TYPE = 9 } GdomeXPathResultType; typedef struct _GdomeXPathEvaluatorVtab GdomeXPathEvaluatorVtab; typedef struct _GdomeXPathNSResolverVtab GdomeXPathNSResolverVtab; typedef struct _GdomeXPathResultVtab GdomeXPathResultVtab; struct _GdomeXPathEvaluator { gpointer user_data; }; struct _GdomeXPathNSResolver { gpointer user_data; }; struct _GdomeXPathResult { gpointer user_data; }; GdomeXPathEvaluator *gdome_xpeval_mkref (void); void gdome_xpeval_ref (GdomeXPathEvaluator *self, GdomeException *exc); void gdome_xpeval_unref (GdomeXPathEvaluator *self, GdomeException *exc); GdomeXPathNSResolver * gdome_xpeval_createNSResolver (GdomeXPathEvaluator *self, GdomeNode *nodeResolver, GdomeException *exc); GdomeXPathResult * gdome_xpeval_createResult (GdomeXPathEvaluator *self, GdomeException *exc); GdomeXPathResult *gdome_xpeval_evaluate (GdomeXPathEvaluator *self, GdomeDOMString *expression, GdomeNode *contextNode, GdomeXPathNSResolver *resolver, unsigned int type, GdomeXPathResult *result, GdomeException *exc); GdomeXPathNSResolver * gdome_xpnsresolv_mkref( GdomeNode *nodeResolver ); void gdome_xpnsresolv_ref (GdomeXPathNSResolver *self, GdomeException *exc); void gdome_xpnsresolv_unref (GdomeXPathNSResolver *self, GdomeException *exc); GdomeDOMString * gdome_xpnsresolv_lookupNamespaceURI( GdomeXPathNSResolver *self, GdomeDOMString *prefix, GdomeException *exc); void gdome_xpresult_ref (GdomeXPathResult *self, GdomeException *exc); void gdome_xpresult_unref (GdomeXPathResult *self, GdomeException *exc); unsigned short gdome_xpresult_resultType (GdomeXPathResult *self, GdomeException *exc); GdomeBoolean gdome_xpresult_booleanValue (GdomeXPathResult *self, GdomeException *exc); double gdome_xpresult_numberValue (GdomeXPathResult *self, GdomeException *exc); GdomeDOMString* gdome_xpresult_stringValue (GdomeXPathResult *self, GdomeException *exc); GdomeNode * gdome_xpresult_singleNodeValue (GdomeXPathResult *self, GdomeException *exc); GdomeNode * gdome_xpresult_iterateNext (GdomeXPathResult *self, GdomeException *exc); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* GDOME_XPATH_H */ gdome2-0.8.1/libgdome/gdome-util.h0000664000076400007640000000420407377235637012414 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-util.h * * CopyRight (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_UTIL_H #define GDOME_UTIL_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ GdomeAttr * gdome_cast_a (GdomeNode *node); GdomeCharacterData * gdome_cast_cd (GdomeNode *node); GdomeCDATASection * gdome_cast_cds (GdomeNode *node); GdomeComment * gdome_cast_c (GdomeNode *node); GdomeDocument * gdome_cast_doc (GdomeNode *node); GdomeDocumentFragment * gdome_cast_df (GdomeNode *node); GdomeDocumentType * gdome_cast_dt (GdomeNode *node); GdomeElement * gdome_cast_el (GdomeNode *node); GdomeEntity * gdome_cast_ent (GdomeNode *node); GdomeEntityReference * gdome_cast_er (GdomeNode *node); GdomeNode * gdome_cast_n (GdomeNode *node); GdomeNotation * gdome_cast_not (GdomeNode *node); GdomeProcessingInstruction * gdome_cast_pi (GdomeNode *node); GdomeText * gdome_cast_t (GdomeNode *node); GdomeEventTarget * gdome_cast_evntt (GdomeNode *node); GdomeEvent * gdome_cast_evnt (GdomeEvent *evt); GdomeMutationEvent * gdome_cast_mevnt (GdomeEvent *evt); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* GDOME_UTIL_H */ gdome2-0.8.1/libgdome/gdome-private-list.h0000664000076400007640000000357107311512646014052 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-private-list.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2000 Anders Carlsson * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_PRIVATE_LIST_H #define GDOME_PRIVATE_LIST_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef struct _GdomePrivateList GdomePrivateList; struct _GdomePrivateList { void *data; GdomePrivateList *next; }; GdomePrivateList *gdome_private_list_append (GdomePrivateList *list, void *data); GdomePrivateList *gdome_private_list_prepend (GdomePrivateList *list, void *data); unsigned int gdome_private_list_length (GdomePrivateList *list); GdomePrivateList *gdome_private_list_remove (GdomePrivateList *list, void *data); GdomePrivateList *gdome_private_list_nth (GdomePrivateList *list, unsigned int n); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* GDOME_PRIVATE_LIST_H */ gdome2-0.8.1/libgdome/gdome-refdebug.h0000664000076400007640000000267007311512646013211 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-refdebug.h * * CopyRight (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_REFDEBUG_H #define GDOME_REFDEBUG_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ typedef enum { GDOME_REFDBG_STR = 0, GDOME_REFDBG_NODE = 1, GDOME_REFDBG_NODELIST = 2, GDOME_REFDBG_NAMEDNODEMAP = 3, GDOME_REFDBG_EVENT = 4, GDOME_REFDBG_EVENTLISTENER = 5, } GdomeRefType; void gdome_refdbg_addRef (void *ref, GdomeRefType type); gint gdome_refdbg_numRef (void *ref, GdomeRefType type); void gdome_refdbg_delRef (void *ref, GdomeRefType type); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* GDOME_REFDEBUG_H */ gdome2-0.8.1/libgdome/gdome-treegc.h0000664000076400007640000000241207740025646012676 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-treegc.h * * CopyRight (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_TREEGC_H #define GDOME_TREEGC_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ int gdome_treegc_livenodes (GdomeNode *node); void gdome_treegc_addNode (GdomeNode *node); void gdome_treegc_delNode (GdomeNode *node); void gdome_treegc_invalidateNode (GdomeNode *node); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* GDOME_TREEGC_H */ gdome2-0.8.1/libgdome/gdome-libxml-util.h0000664000076400007640000000316407515025234013665 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-libxml-util.h * * written by Christian Glahn * * This header is a very limited version of gdomecore/gdome-xml-node.h * It gives access to get or set libxml2 datastructures to Gdome. * This is extremely helpfull to allow the DOM exchange between * different DOM implementations. * * This fuctions are part of a private interface, and are * undocumented and may go away at any time. * DO NOT USE them unless you know what you are doing! * * CopyRight (C) 2002 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_LIBXML_UTIL_H #define GDOME_LIBXML_UTIL_H #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ xmlNode * gdome_xml_n_get_xmlNode ( GdomeNode * node ); GdomeNode * gdome_xml_n_mkref ( xmlNode * n ); #ifdef __cplusplus } #endif /* __cplusplus */ #endif gdome2-0.8.1/libgdome/gdomecore/0000777000076400007640000000000007740102240012174 5gdome2-0.8.1/libgdome/gdomecore/Makefile.in0000664000076400007640000002355407740102240014170 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EXEEXT = @EXEEXT@ GDOME_INCLUDEDIR = @GDOME_INCLUDEDIR@ GDOME_LIBDIR = @GDOME_LIBDIR@ GDOME_LIBS = @GDOME_LIBS@ GDOME_VERSION_INFO = @GDOME_VERSION_INFO@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MIN_VERSION = @GLIB_MIN_VERSION@ GLIB_MKENUMS = @GLIB_MKENUMS@ GLIB_REQUIRED = @GLIB_REQUIRED@ GOBJECT_QUERY = @GOBJECT_QUERY@ HTML_DIR = @HTML_DIR@ LDFLAGS = @LDFLAGS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_MIN_VERSION = @XML_MIN_VERSION@ NULL = INCLUDES = \ -I$(top_srcdir)/libgdome \ -I$(top_srcdir)/libgdome/gdomecore \ -I$(top_srcdir)/libgdome/events \ -I$(top_srcdir)/libgdome/xpath \ $(LIBXML_CFLAGS) \ $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) noinst_LTLIBRARIES = libgdomecore.la libgdomecore_la_SOURCES = \ gdome-xml-xmldtdutil.c \ gdome-xml-xmlmemory.c \ gdome-xml-str.c \ gdome-xml-text.c \ gdome-xml-comment.c \ gdome-xml-cdata.c \ gdome-xml-attribute.c \ gdome-xml-element.c \ gdome-xml-document.c \ gdome-xml-documentt.c \ gdome-xml-documentf.c \ gdome-xml-domimpl.c \ gdome-xml-nnodem.c \ gdome-xml-nodel.c \ gdome-xml-node.c \ gdome-xml-pi.c \ gdome-xml-notation.c \ gdome-xml-entity.c \ gdome-xml-xmlutil.c \ gdome-xml-cdatas.c \ gdome-xml-entityref.c \ gdome-xml-xpns.c \ $(NULL) EXTRA_DIST = \ gdome-xml-xmldtdutil.h \ gdome-xml-xmlmemory.h \ gdome-xml-util.h \ gdome-xml-str.h \ gdome-xml-text.h \ gdome-xml-comment.h \ gdome-xml-cdata.h \ gdome-xml-attribute.h \ gdome-xml-element.h \ gdome-xml-document.h \ gdome-xml-documentt.h \ gdome-xml-documentf.h \ gdome-xml-domimpl.h \ gdome-xml-nnodem.h \ gdome-xml-nodel.h \ gdome-xml-node.h \ gdome-xml-pi.h \ gdome-xml-notation.h \ gdome-xml-entity.h \ gdome-xml-xmlutil.h \ gdome-xml-cdatas.h \ gdome-xml-entityref.h \ gdome-xml-xpns.h \ $(NULL) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../../config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) -I../.. LIBS = @LIBS@ libgdomecore_la_LDFLAGS = libgdomecore_la_LIBADD = libgdomecore_la_OBJECTS = gdome-xml-xmldtdutil.lo \ gdome-xml-xmlmemory.lo gdome-xml-str.lo gdome-xml-text.lo \ gdome-xml-comment.lo gdome-xml-cdata.lo gdome-xml-attribute.lo \ gdome-xml-element.lo gdome-xml-document.lo gdome-xml-documentt.lo \ gdome-xml-documentf.lo gdome-xml-domimpl.lo gdome-xml-nnodem.lo \ gdome-xml-nodel.lo gdome-xml-node.lo gdome-xml-pi.lo \ gdome-xml-notation.lo gdome-xml-entity.lo gdome-xml-xmlutil.lo \ gdome-xml-cdatas.lo gdome-xml-entityref.lo gdome-xml-xpns.lo 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 = $(libgdomecore_la_SOURCES) OBJECTS = $(libgdomecore_la_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps libgdome/gdomecore/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-noinstLTLIBRARIES: clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) distclean-noinstLTLIBRARIES: maintainer-clean-noinstLTLIBRARIES: .c.o: $(COMPILE) -c $< # FIXME: We should only use cygpath when building on Windows, # and only if it is available. .c.obj: $(COMPILE) -c `cygpath -w $<` .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core -rm -f *.$(OBJEXT) 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: libgdomecore.la: $(libgdomecore_la_OBJECTS) $(libgdomecore_la_DEPENDENCIES) $(LINK) $(libgdomecore_la_LDFLAGS) $(libgdomecore_la_OBJECTS) $(libgdomecore_la_LIBADD) $(LIBS) 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 = libgdome/gdomecore 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-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile $(LTLIBRARIES) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: 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-noinstLTLIBRARIES mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \ clean-tags clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-noinstLTLIBRARIES distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \ 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-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \ clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \ 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 # libgdomeincdir = $(includedir)/libgdome # 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: gdome2-0.8.1/libgdome/gdomecore/Makefile.am0000664000076400007640000000300507452524634014163 NULL = INCLUDES = \ -I$(top_srcdir)/libgdome \ -I$(top_srcdir)/libgdome/gdomecore \ -I$(top_srcdir)/libgdome/events \ -I$(top_srcdir)/libgdome/xpath \ $(LIBXML_CFLAGS) \ $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) noinst_LTLIBRARIES = libgdomecore.la libgdomecore_la_SOURCES = \ gdome-xml-xmldtdutil.c \ gdome-xml-xmlmemory.c \ gdome-xml-str.c \ gdome-xml-text.c \ gdome-xml-comment.c \ gdome-xml-cdata.c \ gdome-xml-attribute.c \ gdome-xml-element.c \ gdome-xml-document.c \ gdome-xml-documentt.c \ gdome-xml-documentf.c \ gdome-xml-domimpl.c \ gdome-xml-nnodem.c \ gdome-xml-nodel.c \ gdome-xml-node.c \ gdome-xml-pi.c \ gdome-xml-notation.c \ gdome-xml-entity.c \ gdome-xml-xmlutil.c \ gdome-xml-cdatas.c \ gdome-xml-entityref.c \ gdome-xml-xpns.c \ $(NULL) EXTRA_DIST = \ gdome-xml-xmldtdutil.h \ gdome-xml-xmlmemory.h \ gdome-xml-util.h \ gdome-xml-str.h \ gdome-xml-text.h \ gdome-xml-comment.h \ gdome-xml-cdata.h \ gdome-xml-attribute.h \ gdome-xml-element.h \ gdome-xml-document.h \ gdome-xml-documentt.h \ gdome-xml-documentf.h \ gdome-xml-domimpl.h \ gdome-xml-nnodem.h \ gdome-xml-nodel.h \ gdome-xml-node.h \ gdome-xml-pi.h \ gdome-xml-notation.h \ gdome-xml-entity.h \ gdome-xml-xmlutil.h \ gdome-xml-cdatas.h \ gdome-xml-entityref.h \ gdome-xml-xpns.h \ $(NULL) # libgdomeincdir = $(includedir)/libgdome gdome2-0.8.1/libgdome/gdomecore/gdome-xml-xmldtdutil.c0000664000076400007640000001243007452774575016371 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-xmldtdutil.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* NOTE This file contains some functions that work directly on the gnome-xml tree structure. We use it to make a right implementation of DocumentType interface at gdome2 layer: gnome-xml make difference between internal and external entities and notations. Theese functions are to joining notations and entities in a single hash holded by the Gdome_xml_DocumentType struct. With this functions we also create a wrapper on gnome-xml xmlNotation structs trasforming them in gdome_xmlNotation structs. */ #include #include "gdome.h" #include #include #include #include #include #include "gdome-xml-xmldtdutil.h" typedef struct _hashIterator hashIterator; struct _hashIterator { xmlDoc *doc; xmlHashTable *ht; }; /* Hash Scanner function for gdome_xmlNotationsHashCreate*/ void notationsHashScanner (void *payload, void *data, xmlChar *name) { hashIterator *priv = (hashIterator *)data; xmlNotation *orig_not = (xmlNotation *)payload; gdome_xmlNotation *new_not = NULL; new_not = (gdome_xmlNotation *) xmlMalloc(sizeof(gdome_xmlNotation)); if (new_not == NULL) { xmlGenericError(xmlGenericErrorContext, "gdome_createGdomeNotationsHash : malloc failed\n"); return; } memset(new_not, 0 , sizeof(gdome_xmlNotation)); /* Initialize gdome_xmlNotation struct */ new_not->type = XML_NOTATION_NODE; new_not->name = orig_not->name; new_not->doc = priv->doc; new_not->PublicID = orig_not->PublicID; new_not->SystemID = orig_not->SystemID; new_not->orig = orig_not; /* add the new struct to the new hash */ xmlHashAddEntry (priv->ht, new_not->name, new_not); } /* Hash Scanner function for gdome_xmlEntitiesHashCreate*/ void entitiesHashScanner (void *payload, void *data, xmlChar *name) { hashIterator *priv = (hashIterator *)data; xmlEntity *orig_not = (xmlEntity *)payload; /* add the struct to the new hash */ xmlHashAddEntry (priv->ht, name, orig_not); } /* Clean up a gdome_xmlNotation record */ void notationDeallocator(gdome_xmlNotation *not) { if (not == NULL) return; /* if (not->name != NULL) xmlFree((char *) not->name); if (not->PublicID != NULL) xmlFree((char *) not->PublicID); if (not->SystemID != NULL) xmlFree((char *) not->SystemID); xmlFree(not); */ g_free (not); } /** * gdome_xmlNotationsHashCreate: * @doc: Document that own notations * * Create a gdome notations hash joining external and internal notations hash * of the Document specified. * Returns: a gdome notations hash. */ xmlHashTable * gdome_xmlNotationsHashCreate (xmlDoc *doc) { xmlHashTable *ret = NULL; hashIterator iter; if (doc == NULL) return NULL; if ((doc->extSubset != NULL && doc->extSubset->notations != NULL) || (doc->intSubset != NULL && doc->intSubset->notations != NULL)) { ret = xmlHashCreate(0); iter.doc = doc; iter.ht = ret; } if (doc->extSubset != NULL && doc->extSubset->notations != NULL) xmlHashScan(doc->extSubset->notations, notationsHashScanner, &iter); if (doc->intSubset != NULL && doc->intSubset->notations != NULL) xmlHashScan(doc->intSubset->notations, notationsHashScanner, &iter); return ret; } /** * gdome_xmlNotationsHashFree: * @ht: HashTable to free * * Free the Notations HashTable specified. */ void gdome_xmlNotationsHashFree (xmlHashTable *ht) { xmlHashFree (ht, (xmlHashDeallocator) notationDeallocator); } /** * gdome_xmlEntitiesHashCreate: * @doc: Document that own notations * * Create a gdome entities hash joining external and internal entities hash * of the Document specified. * Returns: a gdome entities hash. */ xmlHashTable * gdome_xmlEntitiesHashCreate (xmlDoc *doc) { xmlHashTable *ret = NULL; hashIterator iter; if (doc == NULL) return NULL; if ((doc->extSubset != NULL && doc->extSubset->entities != NULL) || (doc->intSubset != NULL && doc->intSubset->entities != NULL)) { ret = xmlHashCreate(0); iter.doc = doc; iter.ht = ret; } if (doc->extSubset != NULL && doc->extSubset->entities != NULL) xmlHashScan(doc->extSubset->entities, entitiesHashScanner, &iter); if (doc->intSubset != NULL && doc->intSubset->entities != NULL) xmlHashScan(doc->intSubset->entities, entitiesHashScanner, &iter); return ret; } /** * gdome_xmlEntitiesHashFree: * @ht: HashTable to free * * Free the Entities HashTable specified. */ void gdome_xmlEntitiesHashFree (xmlHashTable *ht) { xmlHashFree (ht, NULL); } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-xmlmemory.c0000664000076400007640000001657307704234332016222 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-xmlmemory.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* NOTE This file contains some functions that work directly on the gnome-xml tree structure. So if something change we'll have to work only on this module. Many of functions implemented here are a copy of functions in libxml2 tree.c file. Differences should be only that in gdome_ ones we set Gdome_xml_Node->n to NULL before calling xmlFree function. */ #include "gdome.h" #include #include #include "gdome-xml-node.h" #include "gdome-treegc.h" static const xmlChar xmlStringText[] = { 't', 'e', 'x', 't', 0 }; static const xmlChar xmlStringTextNoenc[] = { 't', 'e', 'x', 't', 'n', 'o', 'e', 'n', 'c', 0 }; static const xmlChar xmlStringComment[] = { 'c', 'o', 'm', 'm', 'e', 'n', 't', 0 }; void gdome_xmlFreeProp (xmlAttrPtr cur); void gdome_xmlFreePropList (xmlAttrPtr cur); void gdome_xmlFreeNode (xmlNodePtr cur); void gdome_xmlFreeNodeList (xmlNodePtr cur); /** * gdome_xmlFreeSubtree: * @cur: the root node of the subtree to free * * Free a node, this is a recursive behaviour, all the children are freed too. * This function also set to NULL the n field in the Gdome_xml_Node structure. */ void gdome_xmlFreeSubtree (xmlNode *root) { g_return_if_fail (root != NULL); if (root->type == XML_ATTRIBUTE_NODE) gdome_xmlFreeProp ((xmlAttrPtr)root); else gdome_xmlFreeNode ((xmlNodePtr)root); } /** * gdome_xmlFreeProp: * @cur: an attribute * * Free one attribute, all the content is freed too */ void gdome_xmlFreeProp(xmlAttrPtr cur) { if (cur == NULL) return; /* Check for ID removal -> leading to invalid references ! */ if ((cur->parent != NULL) && (cur->parent->doc != NULL) && ((cur->parent->doc->intSubset != NULL) || (cur->parent->doc->extSubset != NULL))) { if (xmlIsID(cur->parent->doc, cur->parent, cur)) xmlRemoveID(cur->parent->doc, cur); } if (cur->name != NULL) xmlFree((char *) cur->name); if (cur->children != NULL) gdome_xmlFreeNodeList(cur->children); if (cur->_private != NULL) gdome_treegc_invalidateNode(cur->_private); xmlFree(cur); } /** * gdome_xmlFreePropList: * @cur: the first property in the list * * Free a property and all its siblings, all the children are freed too. */ void gdome_xmlFreePropList(xmlAttrPtr cur) { xmlAttrPtr next; if (cur == NULL) return; while (cur != NULL) { next = cur->next; gdome_xmlFreeProp(cur); cur = next; } } /** * gdome_xmlFreeNodeList: * @cur: the first node in the list * * Free a node and all its siblings, this is a recursive behaviour, all * the children are freed too. */ void gdome_xmlFreeNodeList(xmlNodePtr cur) { xmlNodePtr next; if (cur == NULL) return; while (cur != NULL) { next = cur->next; /* unroll to speed up freeing the document */ if (cur->type != XML_DTD_NODE) { if ((cur->children != NULL) && (cur->type != XML_ENTITY_REF_NODE)) gdome_xmlFreeNodeList(cur->children); if (cur->properties != NULL) gdome_xmlFreePropList(cur->properties); if ((cur->type != XML_ELEMENT_NODE) && (cur->type != XML_XINCLUDE_START) && (cur->type != XML_XINCLUDE_END) && (cur->type != XML_ENTITY_REF_NODE)) { if (cur->content != NULL) xmlFree(cur->content); } if (((cur->type == XML_ELEMENT_NODE) || (cur->type == XML_XINCLUDE_START) || (cur->type == XML_XINCLUDE_END)) && (cur->nsDef != NULL)) xmlFreeNsList(cur->nsDef); /* * When a node is a text node or a comment, it uses a global static * variable for the name of the node. * * The xmlStrEqual comparisons need to be done when (happened with * XML::libXML and XML::libXSLT) the library is included twice * statically in the binary and a tree allocated by one occurent * of the lib gets freed by the other occurence, in this case * the string addresses compare are not sufficient. */ if ((cur->name != NULL) && (cur->name != xmlStringText) && (cur->name != xmlStringTextNoenc) && (cur->name != xmlStringComment)) { if (cur->type == XML_TEXT_NODE) { if ((!xmlStrEqual(cur->name, xmlStringText)) && (!xmlStrEqual(cur->name, xmlStringTextNoenc))) xmlFree((char *) cur->name); } else if (cur->type == XML_COMMENT_NODE) { if (!xmlStrEqual(cur->name, xmlStringComment)) xmlFree((char *) cur->name); } else xmlFree((char *) cur->name); } /* TODO : derecursivate this function */ if (cur->_private != NULL) gdome_treegc_invalidateNode(cur->_private); xmlFree(cur); } cur = next; } } /** * gdome_xmlFreeNode: * @cur: the node * * Free a node, this is a recursive behaviour, all the children are freed too. * This doesn't unlink the child from the list, use xmlUnlinkNode() first. */ void gdome_xmlFreeNode(xmlNodePtr cur) { if (cur == NULL) return; /* use xmlFreeDtd for DTD nodes */ if (cur->type == XML_DTD_NODE) return; if ((cur->children != NULL) && (cur->type != XML_ENTITY_REF_NODE)) gdome_xmlFreeNodeList(cur->children); if (cur->properties != NULL) gdome_xmlFreePropList(cur->properties); if ((cur->type != XML_ELEMENT_NODE) && (cur->content != NULL) && (cur->type != XML_ENTITY_REF_NODE) && (cur->type != XML_XINCLUDE_END) && (cur->type != XML_XINCLUDE_START)) { xmlFree(cur->content); } /* * When a node is a text node or a comment, it uses a global static * variable for the name of the node. * * The xmlStrEqual comparisons need to be done when (happened with * XML::libXML and XML::libXSLT) the library is included twice statically * in the binary and a tree allocated by one occurent of the lib gets * freed by the other occurence, in this case the string addresses compare * are not sufficient. */ if ((cur->name != NULL) && (cur->name != xmlStringText) && (cur->name != xmlStringTextNoenc) && (cur->name != xmlStringComment)) { if (cur->type == XML_TEXT_NODE) { if ((!xmlStrEqual(cur->name, xmlStringText)) && (!xmlStrEqual(cur->name, xmlStringTextNoenc))) xmlFree((char *) cur->name); } else if (cur->type == XML_COMMENT_NODE) { if (!xmlStrEqual(cur->name, xmlStringComment)) xmlFree((char *) cur->name); } else xmlFree((char *) cur->name); } if (cur->nsDef != NULL) xmlFreeNsList(cur->nsDef); if (cur->_private != NULL) gdome_treegc_invalidateNode(cur->_private); xmlFree(cur); } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-str.c0000664000076400007640000001756207452112010014764 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-str.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 #include #include #include "gdome.h" #include "gdome-refdebug.h" #include "gdome-xml-str.h" void gdome_xml_str_const_unref (GdomeDOMString *self) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_STR); #endif g_free(self); } void gdome_xml_str_unref_own (GdomeDOMString *self) { g_free (self->str); #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_STR); #endif g_free (self); } void gdome_xml_str_unref_xml (GdomeDOMString *self) { xmlFree (self->str); #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_STR); #endif g_free (self); } /** * gdome_xml_str_mkref: * @str: a %NULL terminated string * * Creates a #GdomeDOMString from a statically allocated string. * Returns: the new DOMString object. */ GdomeDOMString * gdome_xml_str_mkref (const gchar *str) { GdomeDOMString *ds; if (str == NULL) return NULL; ds = g_new (GdomeDOMString, 1); #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)ds, GDOME_REFDBG_STR); #endif ds->refcnt = 1; ds->unref = gdome_xml_str_const_unref; ds->str = (gchar *)str; return ds; } /** * gdome_xml_str_mkref_own: * @str: a %NULL terminated string * * Creates a #GdomeDOMString from a dynamically allocated gchar buffer. * Returns: the new DOMString object. */ GdomeDOMString * gdome_xml_str_mkref_own (gchar *str) { GdomeDOMString *ds; if (str == NULL) return NULL; ds = g_new (GdomeDOMString, 1); #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)ds, GDOME_REFDBG_STR); #endif ds->refcnt = 1; ds->unref = gdome_xml_str_unref_own; ds->str = str; return ds; } /** * gdome_xml_str_mkref_xml: * @str: a %NULL terminated string * * Creates a #GdomeDOMString from a xmlChar buffer already allocated by libxml. * DEPRECATED * Returns: the new DOMString object. */ GdomeDOMString * gdome_xml_str_mkref_xml (xmlChar *str) { GdomeDOMString *ds; if (str == NULL) return NULL; ds = g_new (GdomeDOMString, 1); #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)ds, GDOME_REFDBG_STR); #endif ds->refcnt = 1; ds->unref = gdome_xml_str_unref_xml; ds->str = str; return ds; } /** * gdome_xml_str_mkref_dup: * @str: a %NULL terminated string * * Creates a #GdomeDOMString from a static or dynamically allocated gchar * buffer, but a copy of the initializing string is done before construction. * Returns: the new DOMString object. */ GdomeDOMString * gdome_xml_str_mkref_dup (const gchar *str) { GdomeDOMString *ds; if (str == NULL) return NULL; ds = g_new (GdomeDOMString, 1); #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)ds, GDOME_REFDBG_STR); #endif ds->refcnt = 1; ds->unref = gdome_xml_str_unref_own; ds->str = g_strdup(str); return ds; } /** * gdome_xml_str_ref: * @self: DOMString Object ref * * Increase the reference count of the specified #GdomeDOMString. */ void gdome_xml_str_ref (GdomeDOMString *self) { g_return_if_fail (self != NULL); self->refcnt++; } /** * gdome_xml_str_unref: * @self: DOMString Object ref * * Decrease the reference count of the specified #GdomeDOMString. Free the * structure if the object will have zero reference. */ void gdome_xml_str_unref (GdomeDOMString *self) { g_return_if_fail (self != NULL); self->refcnt--; if(self->refcnt == 0) self->unref (self); } /** * gdome_xml_str_equal: * @self: DOMString Object ref * @str: DOMString to be compared * * Returns: %TRUE if the strings are equal, %FALSE otherwise. */ GdomeBoolean gdome_xml_str_equal(GdomeDOMString *self, GdomeDOMString *str) { g_return_val_if_fail (self != NULL, FALSE); if (str == NULL) return FALSE; if(xmlStrEqual((xmlChar *)self->str, (xmlChar *)str->str)) return TRUE; else return FALSE; } /** * gdome_xml_str_equalIgnoreCase: * @self: DOMString Object ref * @str: DOMString to be compared * * Returns: %TRUE if the strings are equal ignoring case, %FALSE otherwise. */ GdomeBoolean gdome_xml_str_equalIgnoreCase(GdomeDOMString *self, GdomeDOMString *str) { g_return_val_if_fail (self != NULL, FALSE); if (str == NULL) return FALSE; if(!xmlStrcasecmp((xmlChar *)self->str, (xmlChar *)str->str)) return TRUE; else return FALSE; } /** * gdome_xml_str_charAt: * @self: DOMString Object ref * @index: the index of the character wanted * * Returns: the @index -th character in the specified string */ gchar gdome_xml_str_charAt (GdomeDOMString *self, int index) { g_return_val_if_fail (self != NULL, '\0'); if (index < 0 || index >= strlen (self->str)) { g_warning ("gdome_str_charAt: out bound error\n"); return '\0'; } return self->str[index]; } /** * gdome_xml_str_concat: * @self: DOMString Object ref * @str: DOMString to be appended * * Returns: a new #GdomeDOMString that is the concatenation of this string * with @str. If @str is %NULL a new reference to this string is returned. */ GdomeDOMString * gdome_xml_str_concat (GdomeDOMString *self, GdomeDOMString *str) { gchar *ret; g_return_val_if_fail (self != NULL, NULL); if (str == NULL) { self->refcnt++; return self; } ret = g_strconcat (self->str, str->str, NULL); return gdome_xml_str_mkref_own (ret); } /** * gdome_xml_str_endsWith: * @self: DOMString Object ref * @suffix: DOMString to check * * Returns: %TRUE if this string ends with @str. */ GdomeBoolean gdome_xml_str_endsWith (GdomeDOMString *self, GdomeDOMString *suffix) { int len_self, len_str; g_return_val_if_fail (self != NULL, FALSE); if (suffix == NULL) { return TRUE; } len_self = strlen (self->str); len_str = strlen (suffix->str); if (len_str > len_self) return FALSE; if(xmlStrEqual((xmlChar *)&(self->str[len_self-len_str]), (xmlChar *)suffix->str)) return TRUE; else return FALSE; } /** * gdome_xml_str_isEmpty: * @self: DOMString Object ref * * Returns: %TRUE if this string is empty, %FALSE otherwise. */ GdomeBoolean gdome_xml_str_isEmpty (GdomeDOMString *self) { if (self != NULL && strlen (self->str) > 0) return TRUE; return FALSE; } /** * gdome_xml_str_length: * @self: DOMString Object ref * * Returns: the length of this string. */ int gdome_xml_str_length (GdomeDOMString *self) { g_return_val_if_fail (self != NULL, 0); return strlen (self->str); } /** * gdome_xml_str_startsWith: * @self: DOMString Object ref * @prefix: DOMString to check * * Returns: %TRUE if this string starts with @str. */ GdomeBoolean gdome_xml_str_startsWith (GdomeDOMString *self, GdomeDOMString *prefix) { int len_self, len_str; g_return_val_if_fail (self != NULL, FALSE); if (prefix == NULL) { return TRUE; } len_self = strlen (self->str); len_str = strlen (prefix->str); if (len_str > len_self) return FALSE; if(!xmlStrncmp((xmlChar *)self->str, (xmlChar *)prefix->str, len_str)) return TRUE; else return FALSE; } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-text.c0000664000076400007640000001626407707256350015161 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-text.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* -------------------------------------------------------------- */ /* --------------------------- Text --------------------------- */ /* -------------------------------------------------------------- */ #include #include "gdome.h" #include "gdome-events.h" #include #include #include #include "gdome-xml-util.h" #include "gdome-xml-xmlutil.h" #include "gdome-xml-str.h" #include "gdome-xml-node.h" #include "gdome-xml-cdata.h" #include "gdome-xml-document.h" #include "gdome-evt-event.h" #include "gdome-evt-mevent.h" #include "gdome-xml-text.h" const GdomeTextVtab gdome_xml_t_vtab = { { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_t_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_cd_data, gdome_xml_cd_set_data, gdome_xml_cd_length, gdome_xml_cd_substringData, gdome_xml_cd_appendData, gdome_xml_cd_insertData, gdome_xml_cd_deleteData, gdome_xml_cd_replaceData }, gdome_xml_t_splitText }; /** * gdome_xml_t_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_t_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_Text *priv = (Gdome_xml_Text *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_T (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "CharacterData") || !strcmp (interface, "Text") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_t_splitText: * @self: The Text Object ref * @offset: The 16-bit unit offset at which to split, starting from 0 * @exc: The GdomeException Object ref * * Breaks this node into two nodes at the specified @offset, keeping both in * the tree as siblings. After being split, this node will contain all the * content up to the @offset point. A new node of the same type, which contains * all the content at and after the @offset point, is returned. If the original * node had a parent node, the new node is inserted as the next sibling of the * original node. When the @offset is equal to the length of this node, the new * node has no data. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * Returns: the new node, of the same type as this node. */ GdomeText * gdome_xml_t_splitText (GdomeText *self, gulong offset, GdomeException *exc) { Gdome_xml_Text *priv = (Gdome_xml_Text *)self; Gdome_xml_Text *new_priv = NULL; GdomeText *ret = NULL; GdomeDocument *owner; GdomeDOMString *new_str = NULL; gulong len; xmlNode *parent; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_T (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } len = gdome_xml_cd_length ((GdomeCharacterData *)self, exc); if (len < offset) { *exc = GDOME_INDEX_SIZE_ERR; return NULL; } /* create the new text node */ owner = gdome_xml_n_ownerDocument ((GdomeNode *)self, exc); if (len == offset) new_str = gdome_xml_str_mkref (""); else new_str = gdome_xml_cd_substringData ((GdomeCharacterData *)self, offset, len - offset, exc); ret = gdome_xml_doc_createTextNode (owner, new_str, exc); gdome_str_unref (new_str); gdome_doc_unref (owner, exc); new_priv = (Gdome_xml_Text *)ret; /* delete splitted data */ gdome_xml_cd_deleteData ((GdomeCharacterData *)self, offset, len - offset, exc); /* insert the new node in the right position */ parent = gdome_xmlGetParent (priv->n); if (parent != NULL) { GdomeMutationEvent *mev; GdomeNode *gparent; gdome_xmlSetParent (new_priv->n, parent); if (gdome_xmlGetLastChild (parent) == priv->n) gdome_xmlSetLastChild (parent, new_priv->n); gparent = gdome_xml_n_mkref (parent); if (gdome_xml_n_eventEnabledByCode ((GdomeNode *) self, DOM_NODE_INSERTED_EVENT_TYPE)) { /* Fire DOMNodeInserted */ mev = gdome_evt_mevnt_mkref (); gdome_xml_n_ref ((GdomeNode *)ret, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_NODE_INSERTED_EVENT_TYPE, TRUE, FALSE, gparent, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)ret, (GdomeEvent *)mev, exc); gdome_xml_n_unref ((GdomeNode *)ret, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if (gdome_xml_n_eventEnabledByCode ((GdomeNode *) self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (gparent, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); gdome_xml_n_unref (gparent, exc); } } gdome_xmlSetNext (new_priv->n, gdome_xmlGetNext (priv->n)); gdome_xmlSetPrev (new_priv->n, priv->n); gdome_xmlSetPrev (gdome_xmlGetNext (priv->n), new_priv->n); gdome_xmlSetNext (priv->n, new_priv->n); return ret; } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-comment.c0000664000076400007640000000621507311512647015625 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-commen.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "gdome.h" #include "gdome-xml-util.h" #include "gdome-xml-node.h" #include "gdome-xml-cdata.h" #include "gdome-xml-comment.h" const GdomeCommentVtab gdome_xml_c_vtab = { { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_c_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_cd_data, gdome_xml_cd_set_data, gdome_xml_cd_length, gdome_xml_cd_substringData, gdome_xml_cd_appendData, gdome_xml_cd_insertData, gdome_xml_cd_deleteData, gdome_xml_cd_replaceData } }; /** * gdome_xml_c_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_c_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_Comment *priv = (Gdome_xml_Comment *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_C (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "CharacterData") || !strcmp (interface, "Comment") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-cdata.c0000664000076400007640000004503107705757471015253 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-cdata.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include "gdome.h" #include "gdome-events.h" #include #include #include #include "gdome-evt-event.h" #include "gdome-evt-mevent.h" #include "gdome-xml-util.h" #include "gdome-xml-xmlutil.h" #include "gdome-xml-str.h" #include "gdome-xml-node.h" #include "gdome-xml-cdata.h" #include "gdome-xml-document.h" const GdomeCharacterDataVtab gdome_xml_cd_vtab = { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_cd_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_cd_data, gdome_xml_cd_set_data, gdome_xml_cd_length, gdome_xml_cd_substringData, gdome_xml_cd_appendData, gdome_xml_cd_insertData, gdome_xml_cd_deleteData, gdome_xml_cd_replaceData }; /* * Some helper functions to work with UTF-8 string as they were UTF-16 string * BEGIN */ /** * gdome_utf16Length: * @utf8str: The UTF-8 string * * Returns: the length of the string speciefied in UTF-16 units. */ gulong gdome_utf16Length (xmlChar *utf8str) { gulong len = 0L, i; char c; for (i = 0L; (c = utf8str[i]) != '\0'; i++) if ((c & 0xf8) == 0xf0) /* FIXME: I'm not sure this is */ len += 2L; /* correct. */ else if ((c & 0xc0) != 0x80) len++; return len; } /** * gdome_utf16Offeset: * @utf8str: The UTF-8 string * @utf16offset: The UTF-16 offset to find * @utf8offset: The pointer where place the resulted UTF-8 offset * * Sets the UTF-8 offset of the UTF-16 offset specified in @utf8offset. * Returns: TRUE if @utf16offset is found, FALSE if it's out of range. */ gboolean gdome_utf16Offset (xmlChar *utf8str, gulong utf16offset, gulong *utf8offset) { gulong len = 0L, i; char c; for (i = 0L; len < utf16offset && (c = utf8str[i]) != '\0'; i++) if ((c & 0xf8) == 0xf0) /* FIXME: I'm not sure this is */ len += 2L; /* correct */ else if ((c & 0xc0) != 0x80) len++; for (;(utf8str[i] & 0xc0) == 0x80; i++); *utf8offset = i; if (len == utf16offset ) return TRUE; else return FALSE; } /* END * Some helper functions to work with UTF-8 string as they were UTF-16 string */ /** * gdome_xml_cd_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_cd_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_CharacterData *priv = (Gdome_xml_CharacterData *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_CD (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "CharacterData") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_cd_data: * @self: The CharacterData Object ref * @exc: The Exception Object ref * * Returns: the character data of the node that implements this interface. */ GdomeDOMString * gdome_xml_cd_data (GdomeCharacterData *self, GdomeException *exc) { Gdome_xml_CharacterData *priv = (Gdome_xml_CharacterData *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_CD (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); return gdome_xml_str_mkref_own (xmlNodeGetContent (priv->n)); } /** * gdome_xml_cd_set_data: * @self: The CharacterData Object ref * @data: The data value for this node * @exc: The Exception Object ref * * Sets the data value of this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_xml_cd_set_data (GdomeCharacterData *self, GdomeDOMString *data, GdomeException *exc) { Gdome_xml_CharacterData *priv = (Gdome_xml_CharacterData *)self; GdomeMutationEvent *mev; GdomeDOMString *prevValue; GdomeNode *parent; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_CD (priv)); g_return_if_fail (data != NULL); g_return_if_fail (exc != NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } prevValue = gdome_xml_cd_data (self, exc); xmlNodeSetContent (priv->n, data->str); if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE)) { /* Fire DOMCharacterDataModified */ mev = gdome_evt_mevnt_mkref (); gdome_str_ref (data); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, prevValue, data, NULL, 0, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)self, (GdomeEvent *)mev, exc); gdome_xml_str_unref (data); gdome_xml_str_unref (prevValue); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ parent = gdome_xml_n_mkref (gdome_xmlGetParent (priv->n)); if (parent != NULL) { mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_n_unref (parent, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } } } /** * gdome_xml_cd_length: * @self: The CharacterData Object ref * @exc: The GdomeException Object ref * * Returns: The number of 16-bit units that are available. This may have the * value zero, i.e., CharacterData nodes may be empty. */ gulong gdome_xml_cd_length (GdomeCharacterData *self, GdomeException *exc) { Gdome_xml_CharacterData *priv = (Gdome_xml_CharacterData *)self; xmlChar *content; gulong length; g_return_val_if_fail (priv != NULL, 0L); g_return_val_if_fail (GDOME_XML_IS_CD (priv), 0L); g_return_val_if_fail (exc != NULL, 0L); content = xmlNodeGetContent (priv->n); length = gdome_utf16Length (content); g_free (content); return length; } /** * gdome_xml_cd_substringData: * @self: The CharacterData Object ref * @offset: Start offset of substring to extract * @count: The number of 16-bit units to extract * @exc: The Exception Object ref * * Extracts a range of data from the node. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * Returns: The specified substring. If the sum of @offset and @count exceeds * the length, then all 16-bit units to the end of the data are returned. */ GdomeDOMString * gdome_xml_cd_substringData (GdomeCharacterData *self, gulong offset, gulong count, GdomeException *exc) { Gdome_xml_CharacterData *priv = (Gdome_xml_CharacterData *)self; xmlChar *ret = NULL; xmlChar *str = NULL; gulong start, stop; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_CD (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); str = xmlNodeGetContent(priv->n); if (!gdome_utf16Offset (str, offset, &start)) { xmlFree (str); *exc = GDOME_INDEX_SIZE_ERR; return NULL; } gdome_utf16Offset (str, offset+count, &stop); ret = (xmlChar *)xmlMalloc (stop - start + 1 * sizeof (xmlChar)); memcpy (ret, str + start, stop - start); ret[stop - start] = '\0'; xmlFree (str); return gdome_xml_str_mkref_own (ret); } /** * gdome_xml_cd_appendData: * @self: The CharacterData Object ref * @arg: The string to append * @exc: The Exception Object ref * * Append the string to the end of the character data of the node. Upon * success, data provides access to the concatenation of data and the * string specified. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_xml_cd_appendData (GdomeCharacterData *self, GdomeDOMString *arg, GdomeException *exc) { Gdome_xml_CharacterData *priv = (Gdome_xml_CharacterData *)self; GdomeMutationEvent *mev; GdomeDOMString *prevValue, *newValue; GdomeNode *parent; xmlChar *old_str, *new_str = NULL; int len1 = 0, len2 = 0; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_CD (priv)); g_return_if_fail (arg != NULL); g_return_if_fail (exc != NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } old_str = xmlNodeGetContent (priv->n); len1 = strlen (old_str); len2 = strlen (arg->str); new_str = xmlMalloc (len1 + len2 + 1 * sizeof (xmlChar)); memcpy (new_str, old_str, len1); memcpy (new_str + len1, arg->str, len2 + 1); xmlNodeSetContent (priv->n, new_str); if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE)) { /* Fire DOMCharacterDataModified */ mev = gdome_evt_mevnt_mkref (); prevValue = gdome_xml_str_mkref (old_str); newValue = gdome_xml_str_mkref (new_str); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, prevValue, newValue, NULL, 0, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)self, (GdomeEvent *)mev, exc); gdome_xml_str_unref (newValue); gdome_xml_str_unref (prevValue); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } g_free (new_str); if (old_str != NULL) xmlFree (old_str); if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ parent = gdome_xml_n_mkref (gdome_xmlGetParent (priv->n)); if (parent != NULL) { mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_n_unref (parent, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } } } /** * gdome_xml_cd_insertData: * @self: The CharacterData Object ref * @offset: The character offset at which to insert * @arg: The string to insert * @exc: The Exception Object ref * * Insert a string at the specified 16-bit unit offset. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_xml_cd_insertData (GdomeCharacterData *self, gulong offset, GdomeDOMString *arg, GdomeException *exc) { Gdome_xml_CharacterData *priv = (Gdome_xml_CharacterData *)self; GdomeMutationEvent *mev; GdomeDOMString *prevValue, *newValue; GdomeNode *parent; xmlChar *old_str, *new_str = NULL; int len1 = 0, len2 = 0; gulong start; if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_CD (priv)); g_return_if_fail (arg != NULL); g_return_if_fail (exc != NULL); old_str = xmlNodeGetContent (priv->n); len1 = strlen (old_str); len2 = strlen (arg->str); if (!gdome_utf16Offset (old_str, offset, &start)) { xmlFree (old_str); *exc = GDOME_INDEX_SIZE_ERR; return; } new_str = xmlMalloc (len1 + len2 + 1 * sizeof (xmlChar)); memcpy (new_str, old_str, start); memcpy (new_str + start, arg->str, len2); memcpy (new_str + start + len2, old_str + start, len1 - start + 1); xmlNodeSetContent (priv->n, new_str); if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE)) { /* Fire DOMCharacterDataModified */ mev = gdome_evt_mevnt_mkref (); prevValue = gdome_xml_str_mkref (old_str); newValue = gdome_xml_str_mkref (new_str); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, prevValue, newValue, NULL, 0, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)self, (GdomeEvent *)mev, exc); gdome_xml_str_unref (newValue); gdome_xml_str_unref (prevValue); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } g_free (new_str); if (old_str != NULL) xmlFree (old_str); if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ parent = gdome_xml_n_mkref (gdome_xmlGetParent (priv->n)); if (parent != NULL) { mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_n_unref (parent, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } } } /** * gdome_xml_cd_deleteData: * @self: The CharacterData Object ref * @offset: The offset from which to start removing * @count: The number of 16-bit units to delete. * @exc: The Exception Object ref * * Remove a range of 16-bit units from the node. If the sum of @offset and * @count exceeds length then all 16-bit units from @offset to the end of the * data are deleted. Upon success, data and length reflect the change. * * %GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_xml_cd_deleteData (GdomeCharacterData *self, gulong offset, gulong count, GdomeException *exc) { Gdome_xml_CharacterData *priv = (Gdome_xml_CharacterData *)self; GdomeMutationEvent *mev; GdomeDOMString *prevValue, *newValue; GdomeNode *parent; xmlChar *old_str, *new_str = NULL; gulong start, stop, len1, len2; if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_CD (priv)); g_return_if_fail (exc != NULL); old_str = xmlNodeGetContent (priv->n); if (!gdome_utf16Offset (old_str, offset, &start)) { xmlFree (old_str); *exc = GDOME_INDEX_SIZE_ERR; return; } gdome_utf16Offset (old_str, offset+count, &stop); len1 = strlen (old_str); len2 = len1 - (stop - start); new_str = (xmlChar *)xmlMalloc (len2 + 1 * sizeof (xmlChar)); memcpy (new_str, old_str, start); memcpy (new_str + start, old_str + stop, len1 - stop); new_str[len2] = '\0'; xmlNodeSetContent (priv->n, new_str); if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE)) { /* Fire DOMCharacterDataModified */ mev = gdome_evt_mevnt_mkref (); prevValue = gdome_xml_str_mkref (old_str); newValue = gdome_xml_str_mkref (new_str); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, prevValue, newValue, NULL, 0, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)self, (GdomeEvent *)mev, exc); gdome_xml_str_unref (newValue); gdome_xml_str_unref (prevValue); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } g_free (new_str); if (old_str != NULL) xmlFree (old_str); if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ parent = gdome_xml_n_mkref (gdome_xmlGetParent (priv->n)); if (parent != NULL) { mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_n_unref (parent, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } } } /** * gdome_xml_cd_replaceData: * @self: The CharacterData Object ref * @offset: The offset from which to start replacing * @count: The number of 16-bit units to replace. * @arg: The String with which the range must be replaced * @exc: The GdomeException Object ref * * Replace the characters starting at the specified 16-bit unit @offset with * the specified string. If the sum of @offset and @count exceeds length, then * all 16-bit units to the end of the data are replaced; * * %GDOME_INDEX_SIZE_ERR: Raised if the specified @offset is greater than the * number of 16-bit units in data. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_xml_cd_replaceData (GdomeCharacterData *self, gulong offset, gulong count, GdomeDOMString *arg, GdomeException *exc) { g_return_if_fail (self != NULL); g_return_if_fail (GDOME_XML_IS_CD (self)); g_return_if_fail (arg != NULL); g_return_if_fail (exc != NULL); gdome_xml_cd_deleteData (self, offset, count, exc); if (*exc == 0) { gdome_xml_cd_insertData (self, offset, arg, exc); if (*exc == GDOME_INDEX_SIZE_ERR) { *exc = 0; gdome_xml_cd_appendData (self, arg, exc); } } } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-attribute.c0000664000076400007640000002176107705757471016206 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-attribute.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "gdome.h" #include "gdome-events.h" #include "gdome-treegc.h" #include #include #include #include "gdome-xml-util.h" #include "gdome-xml-str.h" #include "gdome-xml-node.h" #include "gdome-evt-event.h" #include "gdome-evt-mevent.h" #include "gdome-xml-attribute.h" #include "gdome-xml-xmlutil.h" #include "gdome-xml-document.h" const GdomeAttrVtab gdome_xml_a_vtab = { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_a_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_a_name, gdome_xml_a_ownerElement, gdome_xml_a_specified, gdome_xml_a_value, gdome_xml_a_set_value }; /** * gdome_xml_a_query_interface: * @self: Attr Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_a_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_Attr *priv = (Gdome_xml_Attr *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_A (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "Attr") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_a_mkref_ns * @n: The libxml namespace of which a Gdome reference is wanted * * Constructor of Attribute wrapper to namespace declaration * Returns: the reference to the Gdome Attribute node. */ GdomeNode * gdome_xml_a_mkref_ns (xmlNode *node, xmlNs *ns) { Gdome_xml_Attr *result = NULL; xmlAttr *a; if (ns == NULL) return NULL; if (ns->type == XML_NAMESPACE_DECL) { a = gdome_xmlNewNsDecl(node, ns->prefix, ns->href); result = g_new (Gdome_xml_Attr, 1); result->refcnt = 1; result->vtab = &gdome_xml_a_vtab; result->super.user_data = NULL; result->n = a; result->accessType = GDOME_READONLY_NODE; result->ll = NULL; gdome_treegc_addNode ((GdomeNode *)result); a->_private = result; } else { g_warning ("gdome_xml_a_mkref_ns: invalid node type"); result = NULL; } return (GdomeNode *)result; } /** * gdome_xml_a_unref_ns: * @self: Attr Object ref * @exc: Exception Object ref * * Decrease the reference count of an namespace declaration attribute. * Free the Node structure if the Node will have zero reference */ void gdome_xml_a_unref_ns (GdomeNode *self, GdomeException *exc) { Gdome_xml_Attr *priv = (Gdome_xml_Attr *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_A (priv)); g_return_if_fail (exc != NULL); if (priv->refcnt > 0) priv->refcnt--; if (priv->refcnt == 0) { gdome_treegc_delNode (self); g_free (self); } } /** * gdome_xml_a_name: * @self: Attr Object ref * @exc: Exception Object ref * * Returns: the qualified name of this attribute. */ GdomeDOMString * gdome_xml_a_name (GdomeAttr *self, GdomeException *exc) { Gdome_xml_Attr *priv = (Gdome_xml_Attr *)self; GdomeDOMString *ret = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_A (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if(gdome_xmlGetNs((xmlNode *)priv->n) != NULL) ret = gdome_xml_str_mkref_own (g_strdup_printf("%s:%s", (gchar *) gdome_xmlGetNsPrefix((xmlNode *)priv->n), (gchar *) gdome_xmlGetName((xmlNode *)priv->n))); else ret = gdome_xml_str_mkref_dup((gchar *)gdome_xmlGetName ((xmlNode *)priv->n)); return ret; } /** * gdome_xml_a_ownerElement: * @self: Attr Object ref * @exc: Exception Object ref * * Returns: the Element node this attribute is attached to or %NULL if this * attribute is not in use. */ GdomeElement * gdome_xml_a_ownerElement (GdomeAttr *self, GdomeException *exc) { Gdome_xml_Attr *priv = (Gdome_xml_Attr *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_A (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); return (GdomeElement *)gdome_xml_n_mkref (gdome_xmlGetParent ((xmlNode *)priv->n)); } /** * gdome_xml_a_specified: * @self: Attr Object ref * @exc: Exception Object ref * * NOT IMPLEMENTED * Returns: %TRUE */ GdomeBoolean gdome_xml_a_specified (GdomeAttr *self, GdomeException *exc) { /* FIXME: probably flesh out when dealing with validation. */ return TRUE; } /** * gdome_xml_a_value: * @self: Attr Object ref * @exc: Exception Object ref * * Returns: the value of this attribute. */ GdomeDOMString * gdome_xml_a_value (GdomeAttr *self, GdomeException *exc) { Gdome_xml_Attr *priv = (Gdome_xml_Attr *)self; xmlChar *value = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_A (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); value = xmlNodeGetContent ((xmlNode *)priv->n); if (value != NULL) return gdome_xml_str_mkref_own (value); else return gdome_xml_str_mkref_dup(""); } /** * gdome_xml_a_set_value: * @self: Attr Object ref * @value: The new value to set * @exc: Exception Object ref * * Sets the value of this attribute. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_xml_a_set_value (GdomeAttr *self, GdomeDOMString *value, GdomeException *exc) { Gdome_xml_Attr *priv = (Gdome_xml_Attr *)self; GdomeMutationEvent *mev; GdomeDOMString *prevValue, *attrName; GdomeElement *parent; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_A (priv)); g_return_if_fail (value != NULL); g_return_if_fail (exc != NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } prevValue = gdome_xml_a_value (self, exc); gdome_xmlSetAttrValue (priv->n, (xmlChar *)value->str); /* Fire of events if the Attr is owned by an someone */ parent = gdome_xml_a_ownerElement (self, exc); if (parent != NULL) { if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMAttrModified */ mev = gdome_evt_mevnt_mkref (); attrName = gdome_xml_a_name (self, exc); gdome_xml_str_ref (value); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, (GdomeNode *)self, prevValue, value, attrName, GDOME_MODIFICATION, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)parent, (GdomeEvent *)mev, exc); gdome_xml_str_unref (value); gdome_xml_str_unref (attrName); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)parent, (GdomeEvent *)mev, exc); gdome_xml_n_unref ((GdomeNode *)parent, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } } if (prevValue != NULL) gdome_xml_str_unref (prevValue); } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-element.c0000664000076400007640000007363207737315575015640 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-element.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casrini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "gdome.h" #include "gdome-events.h" #include #include #include #include #include "gdome-xml-util.h" #include "gdome-xml-str.h" #include "gdome-xml-node.h" #include "gdome-xml-nodel.h" #include "gdome-evt-event.h" #include "gdome-evt-mevent.h" #include "gdome-xml-element.h" #include "gdome-xml-attribute.h" #include "gdome-xml-nnodem.h" #include "gdome-xml-xmlutil.h" #include "gdome-xml-document.h" /* vtable for the Element */ const GdomeElementVtab gdome_xml_el_vtab = { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_el_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_el_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_el_tagName, gdome_xml_el_getAttribute, gdome_xml_el_setAttribute, gdome_xml_el_removeAttribute, gdome_xml_el_getAttributeNode, gdome_xml_el_setAttributeNode, gdome_xml_el_removeAttributeNode, gdome_xml_el_getElementsByTagName, gdome_xml_el_getAttributeNS, gdome_xml_el_setAttributeNS, gdome_xml_el_removeAttributeNS, gdome_xml_el_getAttributeNodeNS, gdome_xml_el_setAttributeNodeNS, gdome_xml_el_getElementsByTagNameNS, gdome_xml_el_hasAttribute, gdome_xml_el_hasAttributeNs }; /** * gdome_xml_el_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_el_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "Element") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_el_tagName: * @self: Element Objects ref * @exc: Exception Object ref * * Returns: the qualified name of the element. */ GdomeDOMString * gdome_xml_el_tagName (GdomeElement *self, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; GdomeDOMString *ret = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if(gdome_xmlGetNs(priv->n) != NULL && gdome_xmlGetNsPrefix(priv->n) != NULL ) ret = gdome_xml_str_mkref_own (g_strdup_printf("%s:%s", (gchar *) gdome_xmlGetNsPrefix(priv->n), (gchar *) gdome_xmlGetName(priv->n))); else ret = gdome_xml_str_mkref_dup((gchar *)gdome_xmlGetName (priv->n)); return ret; } /** * gdome_xml_el_attributes: * @self: Element Objects ref * @exc: Exception Object ref * * Returns: a NamedNodeMap of the element's attributes. */ GdomeNamedNodeMap * gdome_xml_el_attributes (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); return gdome_xml_nnm_mkref(gdome_xml_doc_mkref (gdome_xmlGetOwner (priv->n)), (GdomeElement *)self, gdome_xmlGetAttrList(priv->n), gdome_xmlGetNsDeclList(priv->n), priv->accessType, GDOME_ATTRIBUTE_NODE); } /** * gdome_xml_el_getAttribute: * @self: Element Objects ref * @name: The name of attribute of which the value is wanted * @exc: Exception Object ref * * Retrieves an attribute value by name. * Returns: the Attr value as a string, or the empty string if that attribute * does not have a specified or default value. */ GdomeDOMString * gdome_xml_el_getAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; xmlChar *value = NULL; xmlNs *ns = NULL; gchar **strs; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); value = xmlGetProp (priv->n, name->str); if (value != NULL) return gdome_xml_str_mkref_own (value); else { strs = g_strsplit((gchar *)name->str, ":", 0); if (xmlStrEqual(strs[0], "xmlns")) ns = gdome_xmlGetNsDecl(priv->n, strs[1]); g_strfreev(strs); if (ns != NULL) return gdome_xml_str_mkref_dup ((gchar *)ns->href); else return gdome_xml_str_mkref_dup (""); } } /** * gdome_xml_el_setAttribute: * @self: Element Objects ref * @name: The name of the attribute to create or alter * @value: Value to set in string form * @exc: Exception Object ref * * Adds a new attribute. If an attribute with that name is already present in * the element, its value is changed to be that of the value parameter. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. */ void gdome_xml_el_setAttribute (GdomeElement *self, GdomeDOMString *name, GdomeDOMString *value, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; GdomeMutationEvent *mev; GdomeDOMString *prevValue; GdomeNode *attr; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EL (priv)); g_return_if_fail (name != NULL); g_return_if_fail (value != NULL); g_return_if_fail (exc != NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } if (!(strcmp(name->str, "xmlns"))) { gdome_xmlLinkNsDecl (priv->n, NULL, (xmlChar *)value->str); return; } prevValue = gdome_xml_str_mkref_own (xmlGetProp (priv->n, name->str)); attr = gdome_xml_n_mkref ((xmlNode *)xmlSetProp (priv->n, name->str, value->str)); if (attr != NULL) { if (gdome_xml_n_eventEnabledByCode((GdomeNode *)self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMAttrModified */ mev = gdome_evt_mevnt_mkref (); gdome_xml_str_ref (name); gdome_xml_str_ref (value); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, attr, prevValue, value, name, GDOME_MODIFICATION, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)self, (GdomeEvent *)mev, exc); gdome_xml_str_unref (value); gdome_xml_str_unref (name); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } gdome_xml_n_unref (attr, exc); if (gdome_xml_n_eventEnabledByCode((GdomeNode *)self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)self, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } } if (prevValue != NULL) gdome_xml_str_unref (prevValue); } /** * gdome_xml_el_removeAttribute: * @self: Element Objects ref * @name: The name of the attribute to remove * @exc: Exception Object ref * * Removes an attribute by name. If the removed attribute is known to have a * default value, an attribute immediately appears containing the default * value as well as the corresponding namespace URI, local name, and prefix * when applicable. * To remove an attribute by local name and namespace URI, use the * gdome_el_removeAttributeNS() function. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. */ void gdome_xml_el_removeAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; GdomeNamedNodeMap *nnm = NULL; GdomeNode *attr = NULL; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EL (priv)); g_return_if_fail (name != NULL); g_return_if_fail (exc != NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } nnm = gdome_xml_nnm_mkref((GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)gdome_xmlGetOwner (priv->n)), self, gdome_xmlGetAttrList(priv->n), NULL, priv->accessType, GDOME_ATTRIBUTE_NODE); attr = gdome_xml_nnm_removeNamedItem(nnm, name, exc); gdome_xml_nnm_unref(nnm, exc); if (attr != NULL) gdome_xml_n_unref(attr, exc); } /** * gdome_xml_el_getAttributeNode: * @self: Element Objects ref * @name: The name of the attribute to retreive * @exc: Exception Object ref * * Retrieves an attribute node by name. * To retrieve an attribute node by qualified name and namespace URI, use the * gdome_el_getAttributeNodeNS() method. * Returns: the Attr node with the specified @name or %NULL if there is no such * attribute. */ GdomeAttr * gdome_xml_el_getAttributeNode (GdomeElement *self, GdomeDOMString *name, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; GdomeNamedNodeMap *nnm; GdomeAttr *ret; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); nnm = gdome_xml_nnm_mkref((GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)gdome_xmlGetOwner (priv->n)), self, gdome_xmlGetAttrList(priv->n), gdome_xmlGetNsDeclList(priv->n), priv->accessType, GDOME_ATTRIBUTE_NODE); ret = (GdomeAttr *)gdome_xml_nnm_getNamedItem(nnm, name, exc); gdome_xml_nnm_unref(nnm, exc); return ret; } /** * gdome_xml_el_setAttributeNode: * @self: Element Object ref * @newAttr: The Attr node to add to the attribute list * @exc: Exception Object ref * * Adds a new attribute node. If an attribute with that name is already present * in the element, it is replaced by the new one. * To add a new attribute node with a qualified name and namespace URI, use the * gdome_el_setAttributeNodeNS() method. * * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newAttr was created from a different * document than the one that created the element. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * %GDOME_INUSE_ATTRIBUTE_ERR: Raised if @newAttr is already an attribute of * another Element object. The DOM user must explicitly clone Attr nodes to * re-use them in other elements. * Returns: if the @newAttr attribute replaces an existing attribute, the * replaced Attr node is returned, otherwise %NULL is returned. */ GdomeAttr * gdome_xml_el_setAttributeNode (GdomeElement *self, GdomeAttr *newAttr, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; GdomeNamedNodeMap *nnm; GdomeAttr *ret; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (newAttr != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_A (newAttr), NULL); g_return_val_if_fail (exc != NULL, NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } nnm = gdome_xml_nnm_mkref((GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)gdome_xmlGetOwner (priv->n)), self, gdome_xmlGetAttrList(priv->n), NULL, priv->accessType, GDOME_ATTRIBUTE_NODE); ret = (GdomeAttr *)gdome_xml_nnm_setNamedItem(nnm, (GdomeNode *)newAttr, exc); gdome_xml_nnm_unref(nnm, exc); return ret; } /** * gdome_xml_el_removeAttributeNode: * @self: Element Objects ref * @oldAttr: The Attr node to remove from the attribute list * @exc: Exception Object ref * * Removes the specified attribute node. If the removed Attr has a default * value it is immediately replaced. The replacing attribute has the same * namespace URI and local name, as well as the original prefix, when * applicable. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * %GDOME_NOT_FOUND_ERR: Raised if @oldAttr is not an attribute of the element. * Returns: the Attr node that was removed. */ GdomeAttr * gdome_xml_el_removeAttributeNode (GdomeElement *self, GdomeAttr *oldAttr, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; GdomeDOMString *localName, *namespaceURI; GdomeNamedNodeMap *nnm = NULL; GdomeAttr *ret = NULL; xmlAttr *attr = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (oldAttr != NULL, NULL); g_return_val_if_fail(GDOME_XML_IS_A (oldAttr), NULL); g_return_val_if_fail (exc != NULL, NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } attr = (xmlAttr *)((Gdome_xml_Attr *)oldAttr)->n; nnm = gdome_xml_nnm_mkref((GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)gdome_xmlGetOwner (priv->n)), self, gdome_xmlGetAttrList(priv->n), NULL, priv->accessType, GDOME_ATTRIBUTE_NODE); if (attr->ns == NULL) { localName = gdome_xml_str_mkref(gdome_xmlGetName((xmlNode *)attr)); ret = (GdomeAttr *)gdome_xml_nnm_removeNamedItem(nnm, localName, exc); gdome_xml_str_unref(localName); } else { localName = gdome_xml_str_mkref(gdome_xmlGetName((xmlNode *)attr)); namespaceURI = gdome_xml_str_mkref(gdome_xmlGetNsURI((xmlNode *)attr)); ret = (GdomeAttr *)gdome_xml_nnm_removeNamedItemNS(nnm, namespaceURI, localName, exc); gdome_xml_str_unref(localName); gdome_xml_str_unref(namespaceURI); } gdome_nnm_unref (nnm, exc); return ret; } /** * gdome_xml_el_getElementsByTagName: * @self: Element Objects ref * @name: The name of the tag to match on. The special value * matches all * tags. * @exc: Exception Object ref * * Returns: a NodeList of all descendant elements with a given tag name, in the * order in which they are encountered in a preorder traversal of this Element * tree. */ GdomeNodeList * gdome_xml_el_getElementsByTagName (GdomeElement *self, GdomeDOMString *name, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); return gdome_xml_nl_mkref ((GdomeNode*)self, name, NULL, GDOME_READWRITE_NODE); } /** * gdome_xml_el_getElementsByTagNameNS: * @self: Element Objects ref * @namespaceURI: The namespace URI of the elements to match on. The special * value * matches all namespaces. * @localName: The local name of the elements to match on. The special value * * matches all local names. * @exc: Exception Object ref * * Returns: a NodeList of all the descendant elements with a given local name * and namespace URI in the order in which they are encountered in a preorder * traversal of this Element tree. */ GdomeNodeList * gdome_xml_el_getElementsByTagNameNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (namespaceURI != NULL, NULL); g_return_val_if_fail (localName != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); return gdome_xml_nl_mkref ((GdomeNode*)self, localName, namespaceURI, GDOME_READWRITE_NODE); } /** * gdome_xml_el_getAttributeNS: * @self: Element Objects ref * @namespaceURI: The namespaceURI of attribute to retrieve * @localName: The localName of the attribute to retrieve * @exc: Exception Object ref * * Retrieves an attribute value by local name and namespace URI. * Returns: the Attr value as a string, or the empty string if that attribute * does not have a specified or default value. */ GdomeDOMString * gdome_xml_el_getAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; xmlChar *value = NULL; xmlNs *ns = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (namespaceURI != NULL, NULL); g_return_val_if_fail (localName != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); value = xmlGetNsProp (priv->n, localName->str, namespaceURI->str); if (value != NULL) return gdome_xml_str_mkref_own (value); else if (xmlStrEqual(namespaceURI->str, GDOME_XMLNS_NAMESPACE)) { ns = gdome_xmlGetNsDecl(priv->n, localName->str); if (ns != NULL) return gdome_xml_str_mkref_dup ((gchar *)ns->href); else return gdome_xml_str_mkref_dup (""); } else { return gdome_xml_str_mkref_dup (""); } } /** * gdome_xml_el_setAttributeNS: * @self: Element Objects ref * @namespaceURI: The namespace URI of attribute to create or alter * @qualifiedName: The qualifiedName of the attribute to create or alter * @value: Value to set in string form * @exc: Exception Object ref * * Adds a new attribute. If an attribute with the same @namespaceURI and * localName is already present in the element, its value is changed to be * that of the value parameter. * * %GDOME_NAMESPACE_ERR: Raised if the @qualifiedName is malformed, if the * @qualifiedName has a prefix and the @namespaceURI is %NULL, if the * @qualifiedName has a prefix that is "xml" and the @namespaceURI is different * from "http://www.w3.org/XML/1998/namespace", or if the @qualifiedName is * "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/". * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. */ void gdome_xml_el_setAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeDOMString *value, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; gchar **strs; gchar *prefix = NULL; gchar *localName = NULL; xmlNs *ns = NULL; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EL (priv)); g_return_if_fail (namespaceURI != NULL); g_return_if_fail (qualifiedName != NULL); g_return_if_fail (value != NULL); g_return_if_fail (exc != NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } /* test malformed qualifiedName */ strs = g_strsplit((gchar *)qualifiedName->str, ":", 0); if (strs[0] && strs[1] && !strs[2]) { /* there's only one ':' */ if (namespaceURI == NULL) { *exc = GDOME_NAMESPACE_ERR; } else { prefix = g_strdup(strs[0]); localName = g_strdup(strs[1]); if ((!strcmp (prefix, "xml") && strcmp(namespaceURI->str, "http://www.w3.org/XML/1998/namespace"))) { *exc = GDOME_NAMESPACE_ERR; } } } else if (!strs[1] && namespaceURI != NULL) { /* there's no ':' */ prefix = g_strdup(""); localName = g_strdup(strs[0]); if (strcmp (localName, "xmlns")) *exc = GDOME_NAMESPACE_ERR; } else if (strs[0] && strs[1] && strs[2]) { /* there are more than one ':' */ *exc = GDOME_NAMESPACE_ERR; } g_strfreev(strs); if (!*exc) { GdomeMutationEvent *mev; GdomeDOMString *prevValue = NULL; GdomeNode *attr = NULL; if (localName != NULL) { if (!(strcmp(prefix, "xmlns"))) { /* BUG 1001 need to set attr and prevValue so events are fired */ gdome_xmlLinkNsDecl (priv->n, (xmlChar *)localName, (xmlChar *)value->str); } else { xmlDoc * doc = gdome_xmlGetOwner(priv->n); ns = xmlSearchNsByHref (doc, priv->n, (xmlChar *)namespaceURI->str); if(ns == NULL || !xmlStrEqual((xmlChar *)prefix, ns->prefix)) { ns = gdome_xmlNewNs (doc, namespaceURI->str, prefix); } prevValue = gdome_xml_str_mkref_own (xmlGetNsProp (priv->n, (xmlChar *)localName, (xmlChar *)namespaceURI->str)); attr = gdome_xml_n_mkref ((xmlNode *)xmlSetNsProp(priv->n, ns, (xmlChar *)localName, (xmlChar *)value->str)); } g_free(prefix); g_free(localName); } else { prevValue = gdome_xml_str_mkref_own (xmlGetProp (priv->n, (xmlChar *)qualifiedName->str)); attr = gdome_xml_n_mkref ((xmlNode *)xmlSetProp (priv->n, (xmlChar *)qualifiedName->str, (xmlChar *)value->str)); } if (attr != NULL) { if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMAttrModified */ mev = gdome_evt_mevnt_mkref (); gdome_xml_str_ref (qualifiedName); gdome_xml_str_ref (value); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, attr, prevValue, value, qualifiedName, GDOME_MODIFICATION, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)self, (GdomeEvent *)mev, exc); gdome_xml_str_unref (value); gdome_xml_str_unref (qualifiedName); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } gdome_xml_n_unref (attr, exc); if (gdome_xml_n_eventEnabledByCode((GdomeNode *) self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)self, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } } if (prevValue != NULL) gdome_xml_str_unref (prevValue); } else { if (localName != NULL) { g_free (prefix); g_free (localName); } return; } } /** * gdome_xml_el_removeAttributeNS: * @self: Element Objects ref * @namespaceURI: The namespaceURI of attribute to remove * @localName: The localName of the attribute to remove * @exc: Exception Object ref * * Removes an attribute by local name and namespace URI. If the removed * attribute has a default value it is immediately replaced. The replacing * attribute has the same namespace URI and local name, as well as the * original prefix. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. */ void gdome_xml_el_removeAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; GdomeNamedNodeMap *nnm = NULL; GdomeNode *attr = NULL; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EL (priv)); g_return_if_fail (namespaceURI != NULL); g_return_if_fail (localName != NULL); g_return_if_fail (exc != NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } nnm = gdome_xml_nnm_mkref((GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)gdome_xmlGetOwner (priv->n)), self, gdome_xmlGetAttrList(priv->n), NULL, priv->accessType, GDOME_ATTRIBUTE_NODE); attr = (GdomeNode *)gdome_xml_nnm_removeNamedItemNS(nnm, namespaceURI, localName, exc); gdome_xml_nnm_unref(nnm, exc); if (attr != NULL) gdome_xml_n_unref(attr, exc); } /** * gdome_xml_el_getAttributeNodeNS: * @self: Element Objects ref * @namespaceURI: The namespace URI of the attribute to retrieve. * @localName: The local name of the attribute to retrieve. * @exc: Exception Object ref * * Retrieves an Attr node by local name and namespace URI. * Returns: the Attr node with the specified attribute local name and * namespace URI or %NULL if there is no such attribute. */ GdomeAttr * gdome_xml_el_getAttributeNodeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; GdomeNamedNodeMap *nnm; GdomeAttr *ret; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (namespaceURI != NULL, NULL); g_return_val_if_fail (localName != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); nnm = gdome_xml_nnm_mkref((GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)gdome_xmlGetOwner (priv->n)), self, gdome_xmlGetAttrList(priv->n), gdome_xmlGetNsDeclList(priv->n), priv->accessType, GDOME_ATTRIBUTE_NODE); ret = (GdomeAttr *)gdome_xml_nnm_getNamedItemNS(nnm, namespaceURI, localName, exc); gdome_xml_nnm_unref(nnm, exc); return ret; } /** * gdome_xml_el_setAttributeNodeNS: * @self: Element Object ref * @newAttr: The Attr node to add to the attribute list * @exc: Exception Object ref * * Adds a new attribute. If an attribute with that local name and that * namespace URI is already present in the element, it is replaced by the new * one. * * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newAttr was created from a different * document than the one that created the element. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. * %GDOME_INUSE_ATTRIBUTE_ERR: Raised if @newAttr is already an attribute of * another Element object. The DOM user must explicitly clone Attr nodes to * re-use them in other elements. * Returns: if the @newAttr attribute replaces an existing attribute with the * same local name and namespace URI, the replaced Attr node is returned, * otherwise %NULL is returned. */ GdomeAttr * gdome_xml_el_setAttributeNodeNS (GdomeElement *self, GdomeAttr *newAttr, GdomeException *exc) { Gdome_xml_Element *priv = (Gdome_xml_Element *)self; GdomeNamedNodeMap *nnm; GdomeAttr *ret; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail(GDOME_XML_IS_EL (priv), NULL); g_return_val_if_fail (newAttr != NULL, NULL); g_return_val_if_fail(GDOME_XML_IS_A (newAttr), NULL); g_return_val_if_fail (exc != NULL, NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } nnm = gdome_xml_nnm_mkref((GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)gdome_xmlGetOwner (priv->n)), self, gdome_xmlGetAttrList(priv->n), NULL, priv->accessType, GDOME_ATTRIBUTE_NODE); ret = (GdomeAttr *)gdome_xml_nnm_setNamedItemNS(nnm, (GdomeNode *)newAttr, exc); gdome_xml_nnm_unref(nnm, exc); return ret; } /** * gdome_xml_el_hasAttribute: * @self: Element Objects ref * @name: The name of the attribute to look for. * @exc: Exception Object ref * * Returns: %TRUE when an attribute with a given name is specified on this * element or has a default value, %FALSE otherwise. */ GdomeBoolean gdome_xml_el_hasAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; xmlChar *val = NULL; xmlNs *ns = NULL; gchar **strs = NULL; g_return_val_if_fail (priv != NULL, 0); g_return_val_if_fail (GDOME_XML_IS_EL (priv), 0); g_return_val_if_fail (name != NULL, 0); g_return_val_if_fail (exc != NULL, 0); val = xmlGetProp (priv->n, name->str); if (val != NULL) { xmlFree(val); return 1; } else { strs = g_strsplit((gchar *)name->str, ":", 0); if (xmlStrEqual(strs[0], "xmlns")) ns = gdome_xmlGetNsDecl(priv->n, strs[1]); g_strfreev(strs); if (ns != NULL) return 1; else return 0; } } /** * gdome_xml_el_hasAttributeNS: * @self: Element Objects ref * @namespaceURI: The namespaceURI of the attribute to look for. * @localName: The localName of the attribute to look for. * @exc: Exception Object ref * * Returns: %TRUE when an attribute with a given local name and namespace URI * is specified on this element or has a default value, %FALSE otherwise. */ GdomeBoolean gdome_xml_el_hasAttributeNs (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; xmlChar *val; xmlNs *ns; g_return_val_if_fail (priv != NULL, 0); g_return_val_if_fail (GDOME_XML_IS_EL (priv), 0); g_return_val_if_fail (namespaceURI != NULL, 0); g_return_val_if_fail (localName != NULL, 0); g_return_val_if_fail (exc != NULL, 0); val = xmlGetNsProp (priv->n, localName->str, namespaceURI->str); if (val != NULL) { xmlFree(val); return 1; } else if (xmlStrEqual(namespaceURI->str, GDOME_XMLNS_NAMESPACE)) { ns = gdome_xmlGetNsDecl(priv->n, localName->str); if (ns != NULL) return 1; else return 0; } else { return 0; } } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-document.c0000664000076400007640000007014507737315575016021 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-document.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "gdome.h" #include "gdome-events.h" #include "gdome-treegc.h" #include #include #include #include #include "gdome-xml-domimpl.h" #include "gdome-xml-util.h" #include "gdome-xml-str.h" #include "gdome-xml-node.h" #include "gdome-xml-nodel.h" #include "gdome-xml-documentt.h" #include "gdome-evt-event.h" #include "gdome-evt-mevent.h" #include "gdome-xml-document.h" #include "gdome-xml-xmlutil.h" #include "gdome-xml-element.h" typedef struct _idsIterator idsIterator; struct _idsIterator { xmlChar *elementId; xmlNode *element; }; /* ****************************************************************/ /* **************** The Document Virtual Table **************** */ /* ****************************************************************/ const GdomeDocumentVtab gdome_xml_doc_vtab = { { gdome_xml_n_ref, gdome_xml_doc_unref, gdome_xml_doc_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_doc_doctype, gdome_xml_doc_implementation, gdome_xml_doc_documentElement, gdome_xml_doc_createElement, gdome_xml_doc_createDocumentFragment, gdome_xml_doc_createTextNode, gdome_xml_doc_createComment, gdome_xml_doc_createCDATASection, gdome_xml_doc_createProcessingInstruction, gdome_xml_doc_createAttribute, gdome_xml_doc_createEntityReference, gdome_xml_doc_getElementsByTagName, gdome_xml_doc_importNode, gdome_xml_doc_createElementNS, gdome_xml_doc_createAttributeNS, gdome_xml_doc_getElementsByTagNameNS, gdome_xml_doc_getElementById, gdome_xml_doc_createEvent }; /** * gdome_xml_doc_mkref: * @n: The libxml document node of which a Gdome reference is wanted * * Constructor of the Document structure. * Returns: the reference to the Gdome Document wanted. */ GdomeDocument * gdome_xml_doc_mkref (xmlDoc *n) { Gdome_xml_Document *result = NULL; if (n == NULL) return NULL; if (n->_private) { result = (Gdome_xml_Document *)n->_private; /* workaround since doc_unref decreases livenodes if refcnt==0*/ if (result->refcnt == 0) result->livenodes++; result->refcnt++; } else if (n->type == XML_DOCUMENT_NODE || n->type == XML_HTML_DOCUMENT_NODE ) { result = g_new (Gdome_xml_Document, 1); result->refcnt = 1; result->vtab = &gdome_xml_doc_vtab; result->super.user_data = NULL; result->n = n; result->accessType = GDOME_READWRITE_NODE; result->ll = NULL; result->livenodes = 0; /* By default all kind of events can be fired */ result->event_mask = DOM_ALL_EVENT_TYPES; /* result->event_mask = 0; */ n->_private = result; #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)result, GDOME_REFDBG_NODE); #endif gdome_treegc_addNode ((GdomeNode *)result); } else { g_warning ("gdome_xml_doc_mkref: invalid node type"); result = NULL; } return (GdomeDocument *)result; } /** * gdome_xml_doc_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Document Node. Free the Node * structure if the Node will have zero reference. */ void gdome_xml_doc_unref (GdomeNode *self, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_DOC (priv)); g_return_if_fail (exc != NULL); if (priv->refcnt > 0) priv->refcnt--; if (priv->refcnt == 0 && priv->ll == NULL) gdome_treegc_delNode (self); } /*************************** * Implementation of the * Document Interface ***************************/ /** * gdome_xml_doc_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_doc_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "Document") || !strcmp (interface, "DocumentEvent") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_doc_doctype: * @self: Document Object ref * @exc: Exception Object ref * * Returns: The Document Type Declaration associated with this document. The * DOM Level 2 does not support editing the Document Type Declaration. docType * cannot be altered in any way, including through the use of methods inherited * from the Node interface, such as insertNode or removeNode. */ GdomeDocumentType * gdome_xml_doc_doctype (GdomeDocument *self, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; xmlDoc *doc = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); doc = priv->n; if (doc->intSubset != NULL) return (GdomeDocumentType *) gdome_xml_dt_mkref (doc->intSubset); else return NULL; } /** * gdome_xml_doc_implementation: * @self: Document Object ref * @exc: Exception Object ref * * Returns: the DOMImplementation object that handles this document. */ GdomeDOMImplementation * gdome_xml_doc_implementation (GdomeDocument *self, GdomeException *exc) { g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (self), NULL); g_return_val_if_fail (exc != NULL, NULL); /* Always return the global DOMImplementation we have */ return gdome_xml_di_mkref (); } /** * gdome_xml_doc_documentElement: * @self: Document Object ref * @exc: Exception Object ref * * Returns: the root Element of the Document. */ GdomeElement * gdome_xml_doc_documentElement (GdomeDocument *self, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; xmlNode *result; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); result = xmlDocGetRootElement (priv->n); return (GdomeElement *)gdome_xml_n_mkref (result); } /** * gdome_xml_doc_createElement: * @self: Document Object ref * @tagName: The name of the element type to instantiate. * @exc: Exception Object ref * * Creates an element of the type specified. Note that the instance returned * implements the Element interface, so attributes can be specified directly on * the returned object. * To create an element with a qualified name and namespace URI, use the * gdome_doc_createElementNS() function. * Returns: a new Element object with the nodeName attribute set to tagName, * and localName, prefix, and namespaceURI set to %NULL. */ GdomeElement * gdome_xml_doc_createElement (GdomeDocument *self, GdomeDOMString *tagName, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; xmlNode *result = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (tagName != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); result = xmlNewDocNode (priv->n, NULL, tagName->str, NULL); return (GdomeElement *)gdome_xml_n_mkref (result); } /** * gdome_xml_doc_createElementNS: * @self: Document Object ref * @namespaceURI: The namespace URI of the element to create * @qualifiedName: The qualified name of the element to create * @exc: Exception Object ref * * Creates an element of the given qualified name and namespace URI. * * %GDOME_NAMESPACE_ERR: Raised if the @qualifiedName is malformed, if the * @qualifiedName has a prefix and the @namespaceURI is %NULL, or if the * @qualifiedName has a prefix that is "xml" and the @namespaceURI is different * from "http://www.w3.org/XML/1998/namespace". * Returns: a new Element object with the following attributes: * %Node.nodeName = @qualifiedName, * %Node.namespaceURI = @namespaceURI, * %Node.prefix = prefix, extracted from @qualifiedName, * %Node.localName = localName, extracted from @qualifiedName, * %Element.tagName = @qualifiedName. */ GdomeElement * gdome_xml_doc_createElementNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; gchar **strs; gchar *prefix = NULL; gchar *localName = NULL; xmlNs *ns = NULL; xmlNode *result = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (qualifiedName != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); /* test malformed qualifiedName */ strs = g_strsplit((gchar *)qualifiedName->str, ":", 0); if (strs[0] && strs[1] && !strs[2]) { /* there's one ':' */ if (namespaceURI == NULL) { *exc = GDOME_NAMESPACE_ERR; } else { prefix = g_strdup(strs[0]); localName = g_strdup(strs[1]); if ((!strcmp (prefix, "xml") && strcmp(namespaceURI->str, "http://www.w3.org/XML/1998/namespace"))) { *exc = GDOME_NAMESPACE_ERR; } } } else if (!strs[1] && namespaceURI != NULL) { /* there's no ':' */ localName = g_strdup(strs[0]); } else if (strs[0] && strs[1] && strs[2]) { /* there are more than one ':' */ *exc = GDOME_NAMESPACE_ERR; } g_strfreev(strs); if (!*exc) { if (localName != NULL) { ns = gdome_xmlNewNs (priv->n, namespaceURI->str, prefix); result = xmlNewDocNode (priv->n, ns, (xmlChar *)localName, NULL); if (prefix != NULL) g_free (prefix); g_free (localName); } else result = xmlNewDocNode (priv->n, NULL, (xmlChar *)qualifiedName->str, NULL); return (GdomeElement *)gdome_xml_n_mkref (result); } else { if (localName != NULL) { g_free (prefix); g_free (localName); } return NULL; } } /** * gdome_xml_doc_createDocumentFragment: * @self: Document Object ref * @exc: Exception Object ref * * Creates an empty DocumentFragment object. * Returns: the new DocumentFragment object. */ GdomeDocumentFragment * gdome_xml_doc_createDocumentFragment (GdomeDocument *self, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; xmlNode *result = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); result = xmlNewDocFragment (priv->n); return (GdomeDocumentFragment *)gdome_xml_n_mkref (result); } /** * gdome_xml_doc_createTextNode: * @self: Document Object ref * @data: The data for the node * @exc: Exception Object ref * * Creates a Text node given the specified string. * Returns: The new TextNode object. */ GdomeText * gdome_xml_doc_createTextNode (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; xmlNode *result = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (data != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); result = xmlNewDocText (priv->n, data->str); return (GdomeText *)gdome_xml_n_mkref (result); } /** * gdome_xml_doc_createComment: * @self: Document Object ref * @data: The data for the comment contents * @exc: Exception Object ref * * Creates a Comment node whose value is the specified string. * Returns: the new Comment object. */ GdomeComment * gdome_xml_doc_createComment (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; xmlNode *result = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (data != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); result = xmlNewComment (data->str); gdome_xmlSetOwner (result, priv->n); return (GdomeComment *)gdome_xml_n_mkref (result); } /** * gdome_xml_doc_createCDATASection: * @self: Document Object ref * @data: The data for the CDATASection contents * @exc: Exception Object ref * * Creates a CDATASection node whose value is the specified string. * Returns: the new CDATASection object. */ GdomeCDATASection * gdome_xml_doc_createCDATASection (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; xmlNode *result = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (data != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); result = xmlNewCDataBlock (priv->n, data->str, strlen (data->str)); gdome_xmlSetOwner (result, priv->n); return (GdomeCDATASection *)gdome_xml_n_mkref (result); } /** * gdome_xml_doc_createProcessingInstruction: * @self: Document Object ref * @target: The target part of the processing instruction * @data: The data for the node * @exc: Exception Object ref * * Creates a ProcessingInstruction node given the specified name and data * strings. * Returns: The new ProcessingInstruction object. */ GdomeProcessingInstruction * gdome_xml_doc_createProcessingInstruction (GdomeDocument *self, GdomeDOMString *target, GdomeDOMString *data, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; xmlNode *result; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (target != NULL, NULL); g_return_val_if_fail (data != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); result = xmlNewPI (target->str, data->str); gdome_xmlSetOwner (result, priv->n); return (GdomeProcessingInstruction *)gdome_xml_n_mkref (result); } /** * gdome_xml_doc_createAttribute: * @self: Document Object ref * @name: The name of the attribute * @exc: Exception Object ref * * Creates an Attr of the given @name. Note that the Attr instance can then be * set on an Element using the setAttributeNode method. To create an attribute * with a qualified name and namespace URI, use the * gdome_doc_createAttributeNS() method. * Returns: a new Attr object with the nodeName attribute set to @name, and * localName, prefix, and namespaceURI set to %NULL. The value of the attribute * is the empty string. */ GdomeAttr * gdome_xml_doc_createAttribute (GdomeDocument *self, GdomeDOMString *name, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; xmlAttr *result = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); result = xmlNewDocProp (priv->n, name->str, NULL); return (GdomeAttr *)gdome_xml_n_mkref ((xmlNode *)result); } /** * gdome_xml_doc_createAttributeNS: * @self: Document Object ref * @namespaceURI: The namespace URI of the attribute to create * @qualifiedName: The qualified name of the attribute to create * @exc: Exception Object ref * * Creates an attribute of the given qualified name and namespace URI. * * %GDOME_NAMESPACE_ERR: Raised if the @qualifiedName is malformed, if the * @qualifiedName has a prefix and the @namespaceURI is %NUKK, if the * @qualifiedName has a prefix that is "xml" and the @namespaceURI is different * from "http://www.w3.org/XML/1998/namespace", or if the @qualifiedName is * "xmlns" and the @namespaceURI is different from "http://www.w3.org/2000/xmlns/". * Returns: a new Attr object with the following attributes: * %Node.nodeName = @qualifiedName, * %Node.namespaceURI = @namespaceURI, * %Node.prefix = prefix, extracted from @qualifiedName, * %Node.localName = localName, extracted from @qualifiedName, * %Attr.name = @qualifiedName, * %Node.nodeValue = the empty string. */ GdomeAttr * gdome_xml_doc_createAttributeNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; gchar **strs; gchar *prefix = NULL; gchar *localName = NULL; xmlNs *ns = NULL; xmlAttr *result = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (qualifiedName != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); /* test malformed qualifiedName */ strs = g_strsplit((gchar *)qualifiedName->str, ":", 0); if (strs[0] && strs[1] && !strs[2]) { /* there's only one ':' */ if (namespaceURI == NULL) { *exc = GDOME_NAMESPACE_ERR; } else { prefix = g_strdup(strs[0]); localName = g_strdup(strs[1]); if ((!strcmp (prefix, "xml") && strcmp(namespaceURI->str, "http://www.w3.org/XML/1998/namespace"))) { *exc = GDOME_NAMESPACE_ERR; } } } else if (!strs[1] && namespaceURI != NULL) { /* there's no ':' */ prefix = g_strdup(""); localName = g_strdup(strs[0]); if (strcmp (localName, "xmlns")) *exc = GDOME_NAMESPACE_ERR; } else if (strs[0] && strs[1] && strs[2]) { /* there are more than one ':' */ *exc = GDOME_NAMESPACE_ERR; } g_strfreev(strs); if (!*exc) { if (localName != NULL) { result = xmlNewDocProp (priv->n, (xmlChar *)localName, NULL); ns = gdome_xmlNewNs (priv->n, namespaceURI->str, prefix); xmlSetNs((xmlNode *)result, ns); g_free (prefix); g_free (localName); } else result = xmlNewDocProp (priv->n, (xmlChar *)qualifiedName->str, NULL); return (GdomeAttr *)gdome_xml_n_mkref ((xmlNode *)result); } else { if (localName != NULL) { g_free (prefix); g_free (localName); } return NULL; } } /** * gdome_xml_doc_createEntityReference: * @self: Document Object ref * @name: The name of the entity to reference * @exc: Exception Object ref * * Creates an EntityReference object. In addition, if the referenced entity is * known, the child list of the EntityReference node is made the same as that * of the corresponding Entity node. * Returns: the new EntityReference object. */ GdomeEntityReference * gdome_xml_doc_createEntityReference (GdomeDocument *self, GdomeDOMString *name, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; xmlNode *result; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); result = xmlNewReference (priv->n, name->str); return (GdomeEntityReference *)gdome_xml_n_mkref (result); } /* Hash Scanner function for gdome_xml_doc_getElementById */ void idsHashScanner (void *payload, void *data, xmlChar *name) { idsIterator *priv = (idsIterator *)data; if (priv->element == NULL && xmlStrEqual (name, priv->elementId)) priv->element = (xmlNode *)gdome_xmlGetParent ((xmlNode *)((xmlID *)payload)->attr); } /** * gdome_xml_doc_getElementById: * @self: Document Object ref * @elementId: The unique id value for an element * @exc: Exception Object ref * * Returns: the Element whose %ID is given by @elementId. If no such element * exists, returns %NULL. Behavior is not defined if more than one element has * this %ID. */ GdomeElement * gdome_xml_doc_getElementById (GdomeDocument *self, GdomeDOMString *elementId, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; xmlHashTable *ids = NULL; idsIterator iter; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (elementId != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); ids = (xmlHashTable *)priv->n->ids; iter.elementId = (xmlChar *)elementId->str; iter.element = NULL; xmlHashScan(ids, idsHashScanner, &iter); return (GdomeElement *)gdome_xml_n_mkref (iter.element); } /** * gdome_xml_doc_getElementsByTagName: * @self: Document Object ref * @tagName: The name of the tag to match on. The special value * matches * all tags. * @exc: Exception Object ref * * Returns: a NodeList of all the elements with a given tag name in the order * in which they are encountered in a preorder traversal of the Document tree. */ GdomeNodeList * gdome_xml_doc_getElementsByTagName (GdomeDocument *self, GdomeDOMString *tagname, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (tagname != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); return gdome_xml_nl_mkref ((GdomeNode*)self, tagname, NULL, GDOME_READWRITE_NODE); } /** * gdome_xml_doc_getElementsByTagNameNS: * @self: Document Objects ref * @namespaceURI: The namespace URI of the elements to match on. The special * value * matches all namespaces. * @localName: The local name of the elements to match on. The special value * * matches all local names. * @exc: Document Object ref * * Returns: a NodeList of all the descendant elements with a given local name * and namespace URI in the order in which they are encountered in a preorder * traversal of this Document tree. */ GdomeNodeList * gdome_xml_doc_getElementsByTagNameNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (namespaceURI != NULL, NULL); g_return_val_if_fail (localName != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); return gdome_xml_nl_mkref ((GdomeNode*)self, localName, namespaceURI, GDOME_READWRITE_NODE); } /** * gdome_xml_doc_importNode: * @self: Document Objects ref * @importedNode: The node to import. * @deep: If %TRUE, recursively import the subtree under the specified node; * if %FALSE, import only the node itself. This has no effect on Attr, * EntityReference, and Notation nodes. * @exc: Exception Object ref * * * Imports a node from another document to this document. The returned node has * no parent; (parentNode is %NULL). The source node is not altered or removed * from the original document; this method creates a new copy of the source * node. %GDOME_DOCUMENT_NODE, %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE * and %GDOME_ENTITY_NODE nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being imported is not * supported. * Returns: the imported node that belongs to this Document. */ GdomeNode * gdome_xml_doc_importNode (GdomeDocument *self, GdomeNode *importedNode, GdomeBoolean deep, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; Gdome_xml_Node *priv_node = (Gdome_xml_Node *)importedNode; xmlNode *ret = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (importedNode != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); switch (gdome_xml_n_nodeType (importedNode, exc)) { case XML_ATTRIBUTE_NODE: g_assert (gdome_xmlGetOwner ((xmlNode *)priv->n) == priv->n); ret = (xmlNode *)xmlCopyProp ((xmlNode *)priv->n, (xmlAttr *)priv_node->n); gdome_xmlSetParent (ret, NULL); break; case XML_DOCUMENT_FRAG_NODE: case XML_ELEMENT_NODE: case XML_ENTITY_REF_NODE: case XML_PI_NODE: case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_COMMENT_NODE: ret = xmlCopyNode (priv_node->n, deep); xmlSetTreeDoc (ret, priv->n); break; default: *exc = GDOME_NOT_SUPPORTED_ERR; } return gdome_xml_n_mkref (ret); } /** * gdome_xml_doc_createEvent: * @self: Document Objects ref * @eventType: The @eventType parameter specifies the type of Event interface * to be created. * @exc: Exception Object ref * * If the Event interface specified is supported by the implementation this * method will return a new Event of the interface type requested. If the Event * is to be dispatched via the dispatchEvent method the appropriate event init * method must be called after creation in order to initialize the Event's * values. As an example, a user wishing to synthesize some kind of * MutationEvents would call createEvent with the parameter "MutationEvents". * The gdome_mevnt_initMuatationEvent() method could then be called on the * newly created MutationEvent to set the specific type of MutationEvent to be * dispatched and set its context information. * * GDOME_NOT_SUPPORTED_ERR: Raised if the implementation does not support the * type of Event interface requested * Returns: the newly created Event. */ GdomeEvent * gdome_xml_doc_createEvent (GdomeDocument *self, GdomeDOMString *eventType, GdomeException *exc) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), NULL); g_return_val_if_fail (eventType != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (eventType->str, "MutationEvents")) return (GdomeEvent *)gdome_evt_mevnt_mkref (); else if (!strcmp (eventType->str, "Events")) return gdome_evt_evnt_mkref (); else { *exc = GDOME_NOT_SUPPORTED_ERR; return NULL; } } void gdome_xml_doc_enableEventByName (GdomeDocument *self, const char *name) { gdome_xml_doc_enableEventByCode (self, gdome_evt_evnt_codeOfName (name)); } void gdome_xml_doc_enableEventByCode (GdomeDocument *self, guint32 code) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_DOC (priv)); priv->event_mask |= code; } void gdome_xml_doc_disableEventByName (GdomeDocument *self, const char *name) { gdome_xml_doc_disableEventByCode (self, gdome_evt_evnt_codeOfName (name)); } void gdome_xml_doc_disableEventByCode (GdomeDocument *self, guint32 code) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_DOC (priv)); priv->event_mask &= ~code; } /** * gdome_xml_doc_event_is_enabled: * @self: Document Object ref * @mask: The event type to check * * Returns: TRUE if the specified event type is enabled */ GdomeBoolean gdome_xml_doc_eventEnabledByName (GdomeDocument *self, const char *name) { return gdome_xml_doc_eventEnabledByCode (self, gdome_evt_evnt_codeOfName (name)); } GdomeBoolean gdome_xml_doc_eventEnabledByCode (GdomeDocument *self, guint32 code) { Gdome_xml_Document *priv = (Gdome_xml_Document *)self; g_return_val_if_fail (priv != NULL, FALSE); g_return_val_if_fail (GDOME_XML_IS_DOC (priv), FALSE); return (priv->event_mask & code) == code; } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-documentt.c0000664000076400007640000002326507704234332016167 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-documentt.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 #include "gdome.h" #include "gdome-refdebug.h" #include "gdome-treegc.h" #include #include #include #include #include #include "gdome-xml-util.h" #include "gdome-xml-xmlutil.h" #include "gdome-xml-xmldtdutil.h" #include "gdome-xml-str.h" #include "gdome-xml-node.h" #include "gdome-xml-documentt.h" #include "gdome-xml-nnodem.h" const GdomeDocumentTypeVtab gdome_xml_dt_vtab = { { gdome_xml_n_ref, gdome_xml_dt_unref, gdome_xml_dt_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_dt_name, gdome_xml_dt_entities, gdome_xml_dt_notations, gdome_xml_dt_publicId, gdome_xml_dt_systemId, gdome_xml_dt_internalSubset }; /** * gdome_xml_dt_mkref: * @n: The libxml dtd node of which a Gdome reference is wanted * * Constructor of the DocumentType structure. * Returns: the reference to the Gdome DocumentType wanted. */ GdomeDocumentType * gdome_xml_dt_mkref (xmlDtd *n) { Gdome_xml_DocumentType *result = NULL; if (n == NULL) return NULL; if (n->_private) { result = (Gdome_xml_DocumentType *)n->_private; result->refcnt++; } else if (n->type == XML_DOCUMENT_TYPE_NODE || n->type == XML_DTD_NODE) { result = g_new (Gdome_xml_DocumentType, 1); result->refcnt = 1; result->vtab = &gdome_xml_dt_vtab; result->super.user_data = NULL; result->n = n; result->accessType = GDOME_READONLY_NODE; result->ll = NULL; n->_private = result; /* Notations init */ result->notations = gdome_xmlNotationsHashCreate (n->doc); /* Entities init */ result->entities = gdome_xmlEntitiesHashCreate (n->doc); #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)result, GDOME_REFDBG_NODE); #endif if(n->doc) gdome_treegc_addNode ((GdomeNode *)result); } else { g_warning ("gdome_xml_dt_mkref: invalid node type"); result = NULL; } return (GdomeDocumentType *)result; } /** * gdome_xml_dt_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_xml_dt_unref (GdomeNode *self, GdomeException *exc) { Gdome_xml_DocumentType *priv = (Gdome_xml_DocumentType *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_DT (priv)); g_return_if_fail (exc != NULL); if (priv->refcnt > 0) priv->refcnt--; if (priv->refcnt == 0 && priv->ll == NULL) { xmlNode *n = (xmlNode *)priv->n; n->_private = NULL; /* Free Notations */ if (priv->notations != NULL) gdome_xmlNotationsHashFree (priv->notations); /* Free Entities */ if (priv->entities != NULL) gdome_xmlEntitiesHashFree (priv->entities); if(n->doc) gdome_treegc_delNode (self); else /* The node is not linked to a document */ xmlFreeDtd ((xmlDtd *)n); #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } } /** * gdome_xml_dt_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_dt_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_DocumentType *priv = (Gdome_xml_DocumentType *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DT (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "DocumentType") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_dt_name: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: the name of DTD; i.e., the name immediately following the %DOCTYPE * keyword. */ GdomeDOMString * gdome_xml_dt_name (GdomeDocumentType *self, GdomeException *exc) { Gdome_xml_DocumentType *priv = (Gdome_xml_DocumentType *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); return gdome_xml_str_mkref_dup((gchar *)gdome_xmlGetName ((xmlNode *)priv->n)); } /** * gdome_xml_dt_entities: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the general entities, both external and * internal, declared in the DTD. Parameter entities are not contained. * Duplicates are discarded. */ GdomeNamedNodeMap * gdome_xml_dt_entities (GdomeDocumentType *self, GdomeException *exc) { Gdome_xml_DocumentType *priv = (Gdome_xml_DocumentType *)self; xmlDtd *dt; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); dt = priv->n; return gdome_xml_nnm_mkref ((GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)gdome_xmlGetOwner ((xmlNode *)dt)), NULL, priv->entities, NULL, GDOME_READONLY_NODE, GDOME_ENTITY_NODE); } /** * gdome_xml_dt_notations: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the notations declared in the DTD. * Duplicates are discarded. Every node in this map also implements the * Notation interface. */ GdomeNamedNodeMap * gdome_xml_dt_notations (GdomeDocumentType *self, GdomeException *exc) { Gdome_xml_DocumentType *priv = (Gdome_xml_DocumentType *)self; xmlDtd *dt; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); dt = priv->n; return gdome_xml_nnm_mkref ((GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)gdome_xmlGetOwner ((xmlNode *)dt)), NULL, priv->notations, NULL, GDOME_READONLY_NODE, GDOME_NOTATION_NODE); } /** * gdome_xml_dt_publicId: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: the public identifier of the external subset. */ GdomeDOMString * gdome_xml_dt_publicId (GdomeDocumentType *self, GdomeException *exc) { Gdome_xml_DocumentType *priv = (Gdome_xml_DocumentType *)self; xmlDtd *dt; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); dt = priv->n; return gdome_xml_str_mkref_dup ((gchar *)dt->ExternalID); } /** * gdome_xml_dt_systemId: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: the public identifier of the external subset. */ GdomeDOMString * gdome_xml_dt_systemId (GdomeDocumentType *self, GdomeException *exc) { Gdome_xml_DocumentType *priv = (Gdome_xml_DocumentType *)self; xmlDtd *dt; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); dt = priv->n; return gdome_xml_str_mkref_dup ((gchar *)dt->SystemID); } /** * gdome_xml_dt_internalSubset: * @self: DocumentType Object ref * @exc: Exception Object ref * * Returns: The internal subset as a string, or %NULL if there is none or on * error. */ GdomeDOMString * gdome_xml_dt_internalSubset (GdomeDocumentType *self, GdomeException *exc) { Gdome_xml_DocumentType *priv = (Gdome_xml_DocumentType *)self; xmlOutputBuffer *out_buff = NULL; gchar *ret; xmlDtd *is; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); g_assert (priv->n->doc != NULL); g_assert (priv->n->doc->intSubset != NULL); is = priv->n->doc->intSubset; if ((out_buff = xmlAllocOutputBuffer(NULL)) == NULL ) { return NULL; } xmlNodeDumpOutput (out_buff, NULL, (xmlNode *)is, 0, 0, NULL); xmlOutputBufferFlush(out_buff); ret = g_strndup (out_buff->buffer->content, out_buff->buffer->use); (void)xmlOutputBufferClose(out_buff); return gdome_xml_str_mkref_own (ret); } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-documentf.c0000664000076400007640000000571207311512647016150 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-documentf.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "gdome.h" #include "gdome-xml-util.h" #include "gdome-xml-str.h" #include "gdome-xml-node.h" #include "gdome-xml-documentf.h" const GdomeDocumentFragmentVtab gdome_xml_df_vtab = { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_df_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent } }; /** * gdome_xml_df_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_df_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_DocumentFragment *priv = (Gdome_xml_DocumentFragment *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_DF (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "DocumentFragment") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-domimpl.c0000664000076400007640000007361307727712771015645 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-domimpl.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2000 Anders Carlsson * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include "gdome.h" #include "gdome-treegc.h" #include "gdome-xml-node.h" #include "gdome-xml-document.h" #include "gdome-xml-documentt.h" #include "gdome-xml-util.h" #include "gdome-xml-xmlutil.h" #include "gdome-xml-domimpl.h" Gdome_xml_DOMImplementation *gdome_xml_DOMImplementation = NULL; /* vtable for the DOMImplementation */ const GdomeDOMImplementationVtab gdome_xml_di_vtab = { gdome_xml_di_ref, gdome_xml_di_unref, gdome_xml_di_query_interface, gdome_xml_di_hasFeature, gdome_xml_di_createDocumentType, gdome_xml_di_createDocument, gdome_xml_di_freeDoc, gdome_xml_di_createDocFromURI, gdome_xml_di_createDocFromMemory, gdome_xml_di_createDocFromURIWithEntitiesTable, gdome_xml_di_createDocFromMemoryWithEntitiesTable, gdome_xml_di_saveDocToFile, gdome_xml_di_saveDocToMemory, gdome_xml_di_saveDocToFileEnc, gdome_xml_di_saveDocToMemoryEnc, gdome_xml_di_enableEvent, gdome_xml_di_disableEvent, gdome_xml_di_eventIsEnabled }; /** * gdome_xml_di_mkref: * * Constructor of the DOMImplementation interface. * Returns: the reference to the DOMImplementation structure. */ GdomeDOMImplementation * gdome_xml_di_mkref (void) { if (gdome_xml_DOMImplementation == NULL) { gdome_xml_DOMImplementation = g_new (Gdome_xml_DOMImplementation, 1); memset(gdome_xml_DOMImplementation, 0, sizeof(Gdome_xml_DOMImplementation)); gdome_xml_DOMImplementation->refcnt = 1; gdome_xml_DOMImplementation->vtab = &gdome_xml_di_vtab; } else gdome_xml_DOMImplementation->refcnt++; return (GdomeDOMImplementation *)gdome_xml_DOMImplementation; } /** * gdome_xml_di_ref: * @self: DOMImplementation Object ref * @exc: Exception Object ref * * Increase the reference count of the DOMImplementation structure. */ void gdome_xml_di_ref (GdomeDOMImplementation *self, GdomeException *exc) { Gdome_xml_DOMImplementation *priv = (Gdome_xml_DOMImplementation *)self; g_return_if_fail (self != NULL); g_return_if_fail (exc != NULL); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); priv->refcnt++; } /** * gdome_xml_di_unref: * @self: DOMImplementation Object ref * @exc: Exception Object ref * * Decrease the reference count of the DOMImplementation. Free the structure * if DOMImplementation will have zero reference. */ void gdome_xml_di_unref (GdomeDOMImplementation *self, GdomeException *exc) { Gdome_xml_DOMImplementation *priv = (Gdome_xml_DOMImplementation *)self; g_return_if_fail (self != NULL); g_return_if_fail (exc != NULL); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); g_assert (priv->refcnt > 0); priv->refcnt--; if (priv->refcnt == 0) { g_free (self); gdome_xml_DOMImplementation = NULL; } } /** * gdome_xml_di_query_interface: * @self: DOMImplementation Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_di_query_interface (GdomeDOMImplementation *self, const char *interface, GdomeException *exc) { Gdome_xml_DOMImplementation *priv = (Gdome_xml_DOMImplementation *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); if (!strcmp (interface, "DOMImplementation")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_di_hasFeature: * @self: The DOMImplementation Object ref * @feature: The name of the feature to test (case-insensitive). * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature. * Returns: %TRUE if the feature is supported, %FALSE otherwise. */ GdomeBoolean gdome_xml_di_hasFeature (GdomeDOMImplementation *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (feature != NULL, FALSE); g_return_val_if_fail (exc != NULL, FALSE); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); if (version == NULL) return TRUE; if (strcmp (version->str, "1.0") && strcmp (version->str,"2.0")) return FALSE; if (!g_strcasecmp(feature->str, "Core") || !g_strcasecmp(feature->str, "XML") || !g_strcasecmp(feature->str, "Events") || !g_strcasecmp(feature->str, "MutationEVents")) return TRUE; return FALSE; } /** * gdome_xml_di_createDocumentType: * @self: The DOMImplementation Object ref * @qualifiedName: The qualified name of the document type to be created * @publicID: The external subset public identifier * @systemID: The external subset system identifier * @exc: The Exception Object ref * * Creates an empty DocumentType node. Entity declarations and notations are * not made available. Entity reference expansions and default attribute * additions do not occur. It is expected that a future version of the DOM will * provide a way for populating a DocumentType. * * %GDOME_NAMESPACE_ERR: Raised if the qualifiedName is malformed. * Returns: A new DocumentType node. */ GdomeDocumentType * gdome_xml_di_createDocumentType (GdomeDOMImplementation *self, GdomeDOMString *qualifiedName, GdomeDOMString *publicId, GdomeDOMString *systemId, GdomeException *exc) { gchar **strs, *localName = NULL; xmlDtd *n; xmlChar *pch1 = NULL, *pch2 = NULL; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (qualifiedName != NULL, NULL); if (publicId != NULL) pch1 = publicId->str; if (systemId != NULL) pch2 = systemId->str; g_return_val_if_fail (exc != NULL, NULL); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); /* test malformed qualifiedName */ strs = g_strsplit((gchar *)qualifiedName->str, ":", 0); if (strs[0] && strs[1] && strs[2]) { *exc = GDOME_NAMESPACE_ERR; } else if (strs[0] && strs[1] && !strs[2]) { localName = g_strdup(strs[1]); } g_strfreev(strs); if (!*exc) { /* create the new DTD node */ if (localName != NULL) { n = xmlCreateIntSubset (NULL, (xmlChar *)localName, pch1, pch2); g_free(localName); } else n = xmlCreateIntSubset (NULL, (xmlChar *)qualifiedName->str, pch1, pch2); /* FOR THE FUTURE: What about prefix? DOM2 specs about DocumentType interface says: "...the effect of namespaces and the various XML schema efforts on DTD representation are not clearly understood as of this writing." */ return (GdomeDocumentType *)gdome_xml_dt_mkref (n); } else { if (localName != NULL) g_free(localName); return NULL; } } /** * gdome_xml_di_createDocument: * @self: DOMImplementation Object ref * @namespaceURI: The namespace URI of the document element to create * @qualifiedName: The qualified name of the document element to be created * @doctype: The type of document to be created or NULL * @exc: Exception Object ref * * Creates an XML Document object of the specified type with its document * element. * * %GDOME_NAMESPACE_ERR: Raised if the @qualifiedName is malformed, if the * @qualifiedName has a prefix and the @namespaceURI is %NULL, or if the * @qualifiedName has a prefix that is "xml" and the @namespaceURI is different * from "http://www.w3.org/XML/1998/namespace" * %GDOME_WRONG_DOCUMENT_ERR: Raised if @doctype has already been used with a * different document. * Returns: a new Document node. */ GdomeDocument * gdome_xml_di_createDocument (GdomeDOMImplementation *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeDocumentType *doctype, GdomeException *exc) { GdomeDocument *ret = NULL; GdomeElement *docElem; GdomeNode *result = NULL; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (qualifiedName != NULL, NULL); if (doctype != NULL) { g_return_val_if_fail (GDOME_XML_IS_DT(doctype), NULL); if (gdome_xmlGetOwner((xmlNode *)((Gdome_xml_DocumentType *)doctype)->n) != NULL) { *exc = GDOME_WRONG_DOCUMENT_ERR; return NULL; } } g_return_val_if_fail (exc != NULL, NULL); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); ret = (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)xmlNewDoc ("1.0")); g_assert (ret != NULL); /* Add the doctype */ if (doctype != NULL) { xmlDtd *n = xmlCreateIntSubset (((Gdome_xml_Document *)ret)->n, ((Gdome_xml_DocumentType *)doctype)->n->name, ((Gdome_xml_DocumentType *)doctype)->n->ExternalID, ((Gdome_xml_DocumentType *)doctype)->n->SystemID); xmlFreeDtd (((Gdome_xml_DocumentType *)doctype)->n); ((Gdome_xml_DocumentType *)doctype)->n = n; gdome_treegc_addNode ((GdomeNode *)doctype); } docElem = gdome_xml_doc_createElementNS (ret, namespaceURI, qualifiedName, exc); if (!*exc) { result = gdome_xml_n_appendChild((GdomeNode *)ret, (GdomeNode *)docElem, exc); g_assert (result != NULL); gdome_xml_n_unref (result, exc); gdome_xml_n_unref ((GdomeNode *)docElem, exc); return ret; } else { gdome_xml_doc_unref ((GdomeNode *)ret, exc); return NULL; } } /** * gdome_xml_di_freeDoc: * @self: DOMImplementation Object ref * @doc: The Document Object ref to be freed * @exc: Exception Object ref * * DEPRECATED! * Free all objects and structures associated to the Document specified. */ void gdome_xml_di_freeDoc (GdomeDOMImplementation *self, GdomeDocument *doc, GdomeException *exc) { Gdome_xml_Document *priv_doc = (Gdome_xml_Document *)doc; g_return_if_fail (self != NULL); g_return_if_fail (doc != NULL); g_return_if_fail (exc != NULL); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); xmlFreeDoc (priv_doc->n); } /** * gdome_xml_di_createDocFromURI: * @self: DOMImplementation Object ref * @uri: the uri of XML file to load * @mode: specifies if the document is to be parsed, validated or recovered * and if the entity substitution has to be done. * @exc: Exception Object ref * * Loads a XML Document from a URI and build a DOM tree. If @mode is * %GDOME_LOAD_PARSING the document must be well formed, if @mode is * %GDOME_LOAD_VALIDATING the document must valid and if @mode is * %GDOME_LOAD_RECOVERING a tree is built anyway. * If the %GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is * performed (es. @mode = %GDOME_LOAD_PARSING | %GDOME_LOAD_SUBSTITUTE_ENTITIES * ). * If the %GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated * with default attributes from the DTD. * Returns: The Document Object of the created tree or %NULL if an error occur. */ GdomeDocument * gdome_xml_di_createDocFromURI (GdomeDOMImplementation *self, const char *uri, unsigned int mode, GdomeException *exc) { int oldvalue = xmlDoValidityCheckingDefaultValue; GdomeDocument *ret = NULL; int prevSubstValue; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (uri != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); if (mode & GDOME_LOAD_SUBSTITUTE_ENTITIES) prevSubstValue = xmlSubstituteEntitiesDefault (1); else prevSubstValue = xmlSubstituteEntitiesDefault (0); if (mode & GDOME_LOAD_COMPLETE_ATTRS) xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS; switch (mode & (GDOME_LOAD_PARSING | GDOME_LOAD_VALIDATING | GDOME_LOAD_RECOVERING)) { case GDOME_LOAD_PARSING: xmlDoValidityCheckingDefaultValue = 0; ret = (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)xmlParseFile (uri)); break; case GDOME_LOAD_VALIDATING: xmlDoValidityCheckingDefaultValue = 1; ret = (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)xmlParseFile (uri)); break; case GDOME_LOAD_RECOVERING: xmlDoValidityCheckingDefaultValue = 0; ret = (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)xmlRecoverFile (uri)); break; } xmlSubstituteEntitiesDefault (prevSubstValue); xmlDoValidityCheckingDefaultValue = oldvalue; return ret; } /** * gdome_xml_di_createDocFromMemory: * @self: DOMImplementation Object ref * @buffer: a pointer to char array that holds the XML document * @mode: specifies if the document is to be parsed, validated or recovered * and if the entity substitution has to be done. * @exc: Exception Object ref * * Loads a XML Document from a memory buffer and build a DOM tree. If @mode is * %GDOME_LOAD_PARSING the document must be well formed, if @mode is * %GDOME_LOAD_VALIDATING the document must valid and if @mode is * %GDOME_LOAD_RECOVERING a tree is built anyway. * If the %GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is * performed (es. @mode = %GDOME_LOAD_PARSING | %GDOME_LOAD_SUBSTITUTE_ENTITIES * ). * If the %GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated * with default attributes from the DTD. * Returns: The Document Object of the created tree or %NULL if an error occur. */ GdomeDocument * gdome_xml_di_createDocFromMemory (GdomeDOMImplementation *self, char *buffer, unsigned int mode, GdomeException *exc) { int oldvalue = xmlDoValidityCheckingDefaultValue; GdomeDocument *ret = NULL; int size; int prevSubstValue; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (buffer != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); size = strlen (buffer); if (mode & GDOME_LOAD_SUBSTITUTE_ENTITIES) prevSubstValue = xmlSubstituteEntitiesDefault (1); else prevSubstValue = xmlSubstituteEntitiesDefault (0); if (mode & GDOME_LOAD_COMPLETE_ATTRS) xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS; switch (mode & (GDOME_LOAD_PARSING | GDOME_LOAD_VALIDATING | GDOME_LOAD_RECOVERING)) { case GDOME_LOAD_PARSING: xmlDoValidityCheckingDefaultValue = 0; ret = (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)xmlParseMemory (buffer, size)); break; case GDOME_LOAD_VALIDATING: xmlDoValidityCheckingDefaultValue = 1; ret = (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)xmlParseMemory (buffer, size)); break; case GDOME_LOAD_RECOVERING: xmlDoValidityCheckingDefaultValue = 0; ret = (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)xmlRecoverMemory (buffer, size)); break; } xmlSubstituteEntitiesDefault (prevSubstValue); xmlDoValidityCheckingDefaultValue = oldvalue; return ret; } /* Helper variables and function for WithEntityTable APIs*/ static getEntitySAXFunc default_entity_resolver; static xmlHashTable *pfwet_entities; static xmlEntity * pfwet_entity_resolver(void* ctxt, const xmlChar *name) { xmlEntity *entity = NULL; if (default_entity_resolver != NULL) entity = default_entity_resolver(ctxt, name); if (entity == NULL) entity = (xmlEntity *)xmlHashLookup(pfwet_entities, name); if (entity == NULL) fprintf (stderr, "Entity %s not found!\n", name); return entity; } /** * gdome_xml_di_createDocFromURIWithEntitiesTable: * @self: DOMImplementation Object ref * @uri: the uri of XML file to load * @entityTable: array of #GdomeEntitiesTableEntry that define name, value, * publicID ans systemID of entities used but not declared * in DTD. The array must be NULL terminated. * @mode: specifies if the document is to be parsed, validated or recovered * and if the entity substitution has to be done. * @exc: Exception Object ref * * Loads a XML Document using also entity declaration specified in @entityTable * from a URI and build a DOM tree. If @mode is %GDOME_LOAD_PARSING the * document must be well formed, if @mode is %GDOME_LOAD_VALIDATING the * document must valid and if @mode is %GDOME_LOAD_RECOVERING a tree is built * anyway. * If the %GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is * performed (es. @mode = %GDOME_LOAD_PARSING | %GDOME_LOAD_SUBSTITUTE_ENTITIES * ). * If the %GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated * with default attributes from the DTD. * Returns: The Document Object of the created tree or %NULL if an error occur. */ GdomeDocument * gdome_xml_di_createDocFromURIWithEntitiesTable (GdomeDOMImplementation *self, const char *uri, const GdomeEntitiesTableEntry entityTable[], unsigned int mode, GdomeException *exc) { int oldvalue = xmlDoValidityCheckingDefaultValue; xmlParserCtxt *ctxt; xmlDoc *doc; int i, recovery = 0; int prevSubstValue; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (uri != NULL, NULL); g_return_val_if_fail (entityTable != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); if (mode & GDOME_LOAD_SUBSTITUTE_ENTITIES) prevSubstValue = xmlSubstituteEntitiesDefault (1); else prevSubstValue = xmlSubstituteEntitiesDefault (0); if (mode & GDOME_LOAD_COMPLETE_ATTRS) xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS; switch (mode & (GDOME_LOAD_PARSING | GDOME_LOAD_VALIDATING | GDOME_LOAD_RECOVERING)) { case GDOME_LOAD_PARSING: xmlDoValidityCheckingDefaultValue = 0; recovery = 0; break; case GDOME_LOAD_VALIDATING: xmlDoValidityCheckingDefaultValue = 1; recovery = 0; break; case GDOME_LOAD_RECOVERING: xmlDoValidityCheckingDefaultValue = 0; recovery = 1; break; } /* Create the Parser Context and Set the sax getEntity function */ ctxt = xmlCreateFileParserCtxt(uri); if (ctxt == NULL) return NULL; g_assert (ctxt->sax != NULL); default_entity_resolver = ctxt->sax->getEntity; ctxt->sax->getEntity = pfwet_entity_resolver; /* Create the hash Table of entities from entityTable */ if ((doc = xmlNewDoc ("1.0")) == NULL) return NULL; if (xmlCreateIntSubset(doc, NULL, NULL, NULL) == NULL) return NULL; for (i=0; entityTable[i].name != NULL; i++) { xmlAddDocEntity (doc, entityTable[i].name, XML_INTERNAL_GENERAL_ENTITY, entityTable[i].publicID, entityTable[i].systemID, entityTable[i].value); } pfwet_entities = doc->intSubset->entities; /* Parse the XML document */ xmlParseDocument(ctxt); xmlFreeDoc (doc); if ((ctxt->wellFormed) || recovery) doc = ctxt->myDoc; else { doc = NULL; xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL; } xmlFreeParserCtxt(ctxt); xmlSubstituteEntitiesDefault (prevSubstValue); xmlDoValidityCheckingDefaultValue = oldvalue; return (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)doc); } /** * gdome_xml_di_createDocFromMemoryWithEntitiesTable: * @self: DOMImplementation Object ref * @buffer: a pointer to char array that holds the XML document * @entityTable: array of #GdomeEntitiesTableEntry that define name, value, * publicID ans systemID of entities used but not declared * in DTD. The array must be NULL terminated. * @mode: specifies if the document is to be parsed, validated or recovered * and if the entity substitution has to be done. * @exc: Exception Object ref * * Loads a XML Document using also entity declaration specified in @entityTable * from a memory buffer and build a DOM tree. If @mode is %GDOME_LOAD_PARSING * the document must be well formed, if @mode is %GDOME_LOAD_VALIDATING the * document must valid and if @mode is %GDOME_LOAD_RECOVERING a tree is built * anyway. * If the %GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is * performed (es. @mode = %GDOME_LOAD_PARSING | %GDOME_LOAD_SUBSTITUTE_ENTITIES * ). * If the %GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated * with default attributes from the DTD. * Returns: The Document Object of the created tree or %NULL if an error occur. */ GdomeDocument * gdome_xml_di_createDocFromMemoryWithEntitiesTable (GdomeDOMImplementation *self, char *buffer, const GdomeEntitiesTableEntry entityTable[], unsigned int mode, GdomeException *exc) { int oldvalue = xmlDoValidityCheckingDefaultValue; xmlParserCtxt *ctxt; xmlDoc *doc; int i, recovery = 0, size; int prevSubstValue; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (buffer != NULL, NULL); g_return_val_if_fail (entityTable != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); size = strlen (buffer); if (mode & GDOME_LOAD_SUBSTITUTE_ENTITIES) prevSubstValue = xmlSubstituteEntitiesDefault (1); else prevSubstValue = xmlSubstituteEntitiesDefault (0); if (mode & GDOME_LOAD_COMPLETE_ATTRS) xmlLoadExtDtdDefaultValue |= XML_COMPLETE_ATTRS; switch (mode & (GDOME_LOAD_PARSING | GDOME_LOAD_VALIDATING | GDOME_LOAD_RECOVERING)) { case GDOME_LOAD_PARSING: xmlDoValidityCheckingDefaultValue = 0; recovery = 0; break; case GDOME_LOAD_VALIDATING: xmlDoValidityCheckingDefaultValue = 1; recovery = 0; break; case GDOME_LOAD_RECOVERING: xmlDoValidityCheckingDefaultValue = 0; recovery = 1; break; } /* Create the Parser Context and Set the sax getEntity function */ ctxt = xmlCreateMemoryParserCtxt(buffer, size); if (ctxt == NULL) return NULL; g_assert (ctxt->sax != NULL); default_entity_resolver = ctxt->sax->getEntity; ctxt->sax->getEntity = pfwet_entity_resolver; /* Create the hash Table of entities from entityTable */ if ((doc = xmlNewDoc ("1.0")) == NULL) return NULL; if (xmlCreateIntSubset(doc, NULL, NULL, NULL) == NULL) return NULL; for (i=0; entityTable[i].name != NULL; i++) { xmlAddDocEntity (doc, entityTable[i].name, XML_INTERNAL_GENERAL_ENTITY, entityTable[i].publicID, entityTable[i].systemID, entityTable[i].value); } pfwet_entities = doc->intSubset->entities; /* Parse the XML document */ xmlParseDocument(ctxt); xmlFreeDoc (doc); if ((ctxt->wellFormed) || recovery) doc = ctxt->myDoc; else { doc = NULL; xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL; } xmlFreeParserCtxt(ctxt); xmlSubstituteEntitiesDefault (prevSubstValue); xmlDoValidityCheckingDefaultValue = oldvalue; return (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)doc); } /** * gdome_xml_di_saveDocToFile: * @self: DOMImplementation Object ref * @doc: the Document of which the tree is wanted to be saved * @filename: the XML filename to save * @mode: the indentation mode wanted * @exc: Exception Object ref * * Save the DOM tree of the Document specified to file. * Returns: %FALSE in case of failure, %TRUE otherwise. */ GdomeBoolean gdome_xml_di_saveDocToFile (GdomeDOMImplementation *self, GdomeDocument *doc, const char *filename, GdomeSavingCode mode, GdomeException *exc) { Gdome_xml_Document *priv_doc = (Gdome_xml_Document *)doc; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (doc != NULL, FALSE); g_return_val_if_fail (filename != NULL, FALSE); g_return_val_if_fail (exc != NULL, FALSE); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); return (xmlSaveFormatFile (filename, priv_doc->n, mode) != -1); } /** * gdome_xml_di_saveDocToFileEnc: * @self: DOMImplementation Object ref * @doc: the Document of which the tree is wanted to be saved * @filename: the XML filename to save * @encoding: character encoding to use when generating XML text * @mode: the indentation mode wanted * @exc: Exception Object ref * * Save the DOM tree of the Document specified to file with the specified * Character encoding. * Returns: %FALSE in case of failure, %TRUE otherwise. */ GdomeBoolean gdome_xml_di_saveDocToFileEnc (GdomeDOMImplementation *self, GdomeDocument *doc, const char *filename, const char *encoding, GdomeSavingCode mode, GdomeException *exc) { Gdome_xml_Document *priv_doc = (Gdome_xml_Document *)doc; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (doc != NULL, FALSE); g_return_val_if_fail (filename != NULL, FALSE); g_return_val_if_fail (exc != NULL, FALSE); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); return (xmlSaveFormatFileEnc (filename, priv_doc->n, encoding, mode) != -1); } /** * gdome_xml_di_saveDocToMemory: * @self: DOMImplementation Object ref * @doc: the Document of which the tree is wanted to be saved * @mem: the memory pointer where the saved document is returned * @mode: the indentation mode wanted * @exc: Exception Object ref * * Save the DOM tree of the Document specified to a new allocated memory and * return it in the @mem pointer. * Returns: %FALSE in case of failure, %TRUE otherwise. */ GdomeBoolean gdome_xml_di_saveDocToMemory (GdomeDOMImplementation *self, GdomeDocument *doc, char **mem, GdomeSavingCode mode, GdomeException *exc) { Gdome_xml_Document *priv_doc = (Gdome_xml_Document *)doc; int size = 0; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (doc != NULL, FALSE); g_return_val_if_fail (mem != NULL, FALSE); g_return_val_if_fail (exc != NULL, FALSE); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); xmlDocDumpFormatMemory(priv_doc->n, (xmlChar **)mem, &size, mode); if ((mem == NULL) && (size > 0)) return FALSE; else return TRUE; } /** * gdome_xml_di_saveDocToMemoryEnc: * @self: DOMImplementation Object ref * @doc: the Document of which the tree is wanted to be saved * @mem: the memory pointer where the saved document is returned * @encoding: character encoding to use when generating XML text * @mode: the indentation mode wanted * @exc: Exception Object ref * * Save the DOM tree of the Document specified using the specified character * encoding standard to a new allocated memory and return it in the @mem * pointer. * Returns: %FALSE in case of failure, %TRUE otherwise. */ GdomeBoolean gdome_xml_di_saveDocToMemoryEnc (GdomeDOMImplementation *self, GdomeDocument *doc, char **mem, const char *encoding, GdomeSavingCode mode, GdomeException *exc) { Gdome_xml_Document *priv_doc = (Gdome_xml_Document *)doc; int size = 0; g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (doc != NULL, FALSE); g_return_val_if_fail (mem != NULL, FALSE); g_return_val_if_fail (encoding != NULL, FALSE); g_return_val_if_fail (exc != NULL, FALSE); g_assert(self == (GdomeDOMImplementation *)gdome_xml_DOMImplementation); xmlDocDumpFormatMemoryEnc(priv_doc->n, (xmlChar **)mem, &size, encoding, mode); if ((mem == NULL) && (size > 0)) return FALSE; else return TRUE; } /** * gdome_xml_di_enableEvent: * @self: DOMImplementation Object ref * @doc: the Document on which we want to enable events * @name: the name of the event type to enable * @exc: Exception Object ref * * Enables the propagation of the event type specified. */ void gdome_xml_di_enableEvent (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc) { g_return_if_fail (self != NULL); g_return_if_fail (doc != NULL); g_return_if_fail (name != NULL); gdome_xml_doc_enableEventByName(doc, name); } /** * gdome_xml_di_disableEvent: * @self: DOMImplementation Object ref * @doc: the Document on which we want to disable events * @name: the name of the event type to disable * @exc: Exception Object ref * * Disables the propagation of the event type specified. */ void gdome_xml_di_disableEvent (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc) { g_return_if_fail (self != NULL); g_return_if_fail (doc != NULL); g_return_if_fail (name != NULL); gdome_xml_doc_disableEventByName(doc, name); } /** * gdome_xml_di_eventIsEnabled: * @self: DOMImplementation Object ref * @doc: the Document on which we want to make the check * @name: the name of the event type to check * @exc: Exception Object ref * * Checks if the specified event type is enabled. * Returns: %TRUE if the event type specified is enabled, %FALSE otherwise. */ GdomeBoolean gdome_xml_di_eventIsEnabled (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc) { g_return_val_if_fail (self != NULL, FALSE); g_return_val_if_fail (doc != NULL, FALSE); g_return_val_if_fail (name != NULL, FALSE); return gdome_xml_doc_eventEnabledByName(doc, name); } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-nnodem.c0000664000076400007640000007516107711744322015452 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-nnm.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2000 Anders Carlsson * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 "gdome.h" #include "gdome-events.h" #include "gdome-refdebug.h" #include "gdome-treegc.h" #include #include #include #include #include "gdome-xml-util.h" #include "gdome-xml-attribute.h" #include "gdome-xml-document.h" #include "gdome-xml-element.h" #include "gdome-xml-str.h" #include "gdome-evt-event.h" #include "gdome-evt-mevent.h" #include "gdome-xml-nnodem.h" #include "gdome-xml-xmlutil.h" typedef struct _nodeIterator nodeIterator; struct _nodeIterator { gulong cur; gulong index; xmlNode *node; }; const GdomeNamedNodeMapVtab gdome_xml_nnm_vtab = { gdome_xml_nnm_ref, gdome_xml_nnm_unref, gdome_xml_nnm_query_interface, gdome_xml_nnm_getNamedItem, gdome_xml_nnm_setNamedItem, gdome_xml_nnm_removeNamedItem, gdome_xml_nnm_item, gdome_xml_nnm_length, gdome_xml_nnm_getNamedItemNS, gdome_xml_nnm_setNamedItemNS, gdome_xml_nnm_removeNamedItemNS }; void itemHashScanner (void *payload, void *data, xmlChar *name) { nodeIterator *priv = (nodeIterator *)data; if(priv->cur < priv->index) priv->cur++; else if(priv->node == NULL) priv->node = (xmlNode *)payload; } /** * gdome_xml_nnm_mkref: * @doc: the Document owner ref * @elem: the Element owner ref, can be %NULL * @data: the pointer to the structure to export as NamedNodeMap * @data2: extra data, used for getAttributes * @readonly: %TRUE if the GdomeNamedNodeMap is readonly * @type: the type of the @data structure passed * * Construct the NamedNodeMap Object. * Returns: a pointer to the GdomeNamedNodeMap Object. */ GdomeNamedNodeMap * gdome_xml_nnm_mkref (GdomeDocument *doc, GdomeElement *elem, void *data, void *data2, GdomeAccessType accessType, GdomeNodeType type) { Gdome_xml_NamedNodeMap *result = NULL; GdomeException exc; if (doc == NULL) return NULL; result = g_new (Gdome_xml_NamedNodeMap, 1); memset(result, 0, sizeof(Gdome_xml_NamedNodeMap)); #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)result, GDOME_REFDBG_NAMEDNODEMAP); #endif result->refcnt = 1; result->vtab = &gdome_xml_nnm_vtab; result->doc = doc; if (elem != NULL) gdome_xml_n_ref ((GdomeNode *)elem, &exc); result->elem = elem; if(type == GDOME_ENTITY_NODE || type == GDOME_NOTATION_NODE) result->data.ht = (xmlHashTable *)data; else if(type == GDOME_ATTRIBUTE_NODE) { result->data.lst = (xmlNode *)data; result->ns = (xmlNs *)data2; } else { g_free(result); return NULL; } result->accessType = accessType; result->type = type; return (GdomeNamedNodeMap *) result; } /** * gdome_xml_nnm_ref: * @self: NodeList Object ref * @exc: Exception Object ref * * Increase the reference count of the specified NamedNodeMap. */ void gdome_xml_nnm_ref (GdomeNamedNodeMap *self, GdomeException *exc) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; g_return_if_fail (self != NULL); g_return_if_fail (exc != NULL); priv->refcnt++; } /** * gdome_xml_nnm_unref: * @self: NodeList Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified NamedNodeMap. Free the * NamedNodeMap structure if the specified NamedNodeMap will have zero * reference. */ void gdome_xml_nnm_unref (GdomeNamedNodeMap *self, GdomeException *exc) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; g_return_if_fail (self != NULL); g_return_if_fail (exc != NULL); priv->refcnt--; if (priv->refcnt == 0) { gdome_xml_n_unref ((GdomeNode *)priv->doc, exc); if (priv->elem != NULL) gdome_xml_n_unref ((GdomeNode *)priv->elem, exc); #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NAMEDNODEMAP); #endif g_free (self); } } /** * gdome_xml_nnm_query_interface: * @self: NamedNodeMap Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_nnm_query_interface (GdomeNamedNodeMap *self, const char *interface, GdomeException *exc) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "NamedNodeMap")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_nnm_length: * @self: NamedNodeMap Objects ref * @exc: Exception Object ref * * Returns: the number of nodes in this map. The range of valid child node * indices is 0 to length-1 inclusive. */ gulong gdome_xml_nnm_length (GdomeNamedNodeMap *self, GdomeException *exc) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; xmlHashTable *ht; xmlNode *n; xmlNs *ns; long result = 0L; g_return_val_if_fail (priv != NULL, 0L); g_return_val_if_fail (exc != NULL, 0L); /* HashTable */ if (priv->type == GDOME_ENTITY_NODE || priv->type == GDOME_NOTATION_NODE) { ht = priv->data.ht; if((result = xmlHashSize(ht)) == -1) return 0L; } /* List */ else if (priv->type == GDOME_ATTRIBUTE_NODE) { for(n = priv->data.lst; n != NULL; n = n->next, result++); for(ns = priv->ns; ns != NULL; ns = ns->next, result++); } return result; } /** * gdome_xml_nnm_getNamedItem: * @self: NamedNodeMap Objects ref * @name: The nodeName of the node to retrieve. * @exc: Exception Object ref * * Retrieves a node specified by name. * Returns: a Node (of any type) with the specified nodeName, or %NULL if it * does not identify any node in this map. */ GdomeNode * gdome_xml_nnm_getNamedItem (GdomeNamedNodeMap *self, GdomeDOMString *name, GdomeException *exc) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; xmlHashTable *ht = NULL; xmlNode *n = NULL; xmlNs *ns = NULL; gchar **strs = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); /* HashTable */ if (priv->type == GDOME_ENTITY_NODE || priv->type == GDOME_NOTATION_NODE) { ht = priv->data.ht; n = (xmlNode*) xmlHashLookup (ht, (xmlChar *) name->str); } /* List */ else if (priv->type == GDOME_ATTRIBUTE_NODE) { strs = g_strsplit((gchar *)name->str, ":", 0); if (xmlStrEqual(strs[0], "xmlns")) { n = ((Gdome_xml_Element *)priv->elem)->n; ns = gdome_xmlGetNsDecl(n, (xmlChar *)strs[1]); g_strfreev(strs); if (ns != NULL) { return (GdomeNode *) gdome_xml_a_mkref_ns (n, ns); } else { return NULL; } } g_strfreev(strs); n = (xmlNode *)gdome_xmlGetAttr(((Gdome_xml_Element *)priv->elem)->n, (xmlChar *)name->str); } if(n != NULL) return (GdomeNode *) gdome_xml_n_mkref (n); else return NULL; } /** * gdome_xml_nnm_getNamedItemNS: * @self: NamedNodeMap Objects ref * @namespaceURI: The namespace URI of the node to retrieve. * @localName: The local name of the node to retrieve. * @exc: Exception Object ref * * Retrieves a node specified by local name and namespace URI. * Returns: a Node (of any type) with the specified local name and namespace * URI, or %NULL if they do not identify any node in this map. */ GdomeNode * gdome_xml_nnm_getNamedItemNS (GdomeNamedNodeMap *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; xmlHashTable *ht = NULL; xmlNode *n = NULL; xmlNs *ns = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (localName != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (namespaceURI == NULL) return gdome_xml_nnm_getNamedItem (self, localName, exc); /* HashTable */ if (priv->type == GDOME_ENTITY_NODE || priv->type == GDOME_NOTATION_NODE) { ht = priv->data.ht; n = (xmlNode*) xmlHashLookup2 (ht, (xmlChar *) localName->str, (xmlChar *) namespaceURI->str); } /* List */ else if (priv->type == GDOME_ATTRIBUTE_NODE) { if (xmlStrEqual(namespaceURI->str, GDOME_XMLNS_NAMESPACE)) { n = ((Gdome_xml_Element *)priv->elem)->n; ns = gdome_xmlGetNsDecl(n, (xmlChar *)localName->str); if (ns != NULL) return (GdomeNode *) gdome_xml_a_mkref_ns (n, ns); else return NULL; } else { n = (xmlNode *)gdome_xmlGetNsAttr(((Gdome_xml_Element *)priv->elem)->n, (xmlChar *)namespaceURI->str, (xmlChar *)localName->str); } } if(n != NULL) return (GdomeNode *) gdome_xml_n_mkref (n); else return NULL; } /** * gdome_xml_nnm_item: * @self: NamedNodeMap Objects ref * @index: Index into this map. * @exc: Exception Object ref * * Returns: the indexth item in the map. If index is greater than or equal to * the number of nodes in this map, this returns %NULL. */ GdomeNode * gdome_xml_nnm_item (GdomeNamedNodeMap *self, gulong index, GdomeException *exc) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; xmlNode *n = NULL; xmlNs *ns = NULL; xmlHashTable *ht; nodeIterator *iter; gulong cur; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); /* HashTable */ if (priv->type == GDOME_ENTITY_NODE || priv->type == GDOME_NOTATION_NODE) { ht = priv->data.ht; iter = g_new(nodeIterator, 1); iter->cur = 0L; iter->index = index; iter->node = NULL; xmlHashScan(ht, itemHashScanner, iter); n = iter->node; g_free(iter); } /* List */ else if (priv->type == GDOME_ATTRIBUTE_NODE) { for(n = priv->data.lst, cur = 0; n != NULL && cur < index; cur++, n = n->next); if (n == NULL) { for (ns = priv->ns; ns != NULL && cur < index; cur++, ns = ns->next); return gdome_xml_a_mkref_ns (((Gdome_xml_Element *)priv->elem)->n, ns); } } return gdome_xml_n_mkref (n); } /** * gdome_xml_nnm_removeNamedItem: * @self: NamedNodeMap Objects ref * @name: The nodeName of the node to remove. * @exc: Exception Object ref * * Removes a node specified by name. When this map contains the attributes * attached to an element, if the removed attribute is known to have a default * value, an attribute immediately appears containing the default value as * well as the corresponding namespace URI, local name, and prefix when applicable. * * %GDOME_NOT_FOUND_ERR: Raised if there is no node named @name in this map. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. * Returns: the node removed from this map if a node with such a name exists. */ GdomeNode * gdome_xml_nnm_removeNamedItem (GdomeNamedNodeMap *self, GdomeDOMString *name, GdomeException *exc) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; GdomeNode *ret = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (priv->accessType == GDOME_READONLY_NODE) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } /* Hash Table */ if (priv->type == GDOME_ENTITY_NODE || priv->type == GDOME_NOTATION_NODE) { xmlHashTable *ht = priv->data.ht; if((ret = gdome_xml_nnm_getNamedItem(self, name, exc)) != NULL) { xmlHashRemoveEntry(ht, name->str, NULL); return ret; } } /* List */ else if (priv->type == GDOME_ATTRIBUTE_NODE) { GdomeNode *parent = gdome_xml_n_mkref (((Gdome_xml_Element *)priv->elem)->n); Gdome_xml_Node *parent_priv = (Gdome_xml_Node *)parent; xmlChar *defaultvalue = NULL; GdomeNode *defaultattr = NULL; GdomeMutationEvent *mev; GdomeDOMString *attrName; gchar **strs = NULL; strs = g_strsplit((gchar *)name->str, ":", 0); if (xmlStrEqual(strs[0], "xmlns")) { xmlNs *ns = gdome_xmlUnlinkNsDecl(parent_priv->n, strs[1]); /* ns is no longer in libxml tree, need to add it back so that it will get freed when libxml doc tree is freed */ gdome_xmlSetOldNs(parent_priv->n->doc, ns); ret = gdome_xml_a_mkref_ns (parent_priv->n, ns); } else ret = gdome_xml_n_mkref ((xmlNode *)gdome_xmlUnlinkAttr(parent_priv->n, name->str)); if(ret != NULL) { if (gdome_xml_nnm_eventEnabledByCode (self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMAttrModified */ mev = gdome_evt_mevnt_mkref (); attrName = gdome_xml_n_nodeName (ret, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, ret, NULL, NULL, attrName, GDOME_REMOVAL, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_str_unref (attrName); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } /* resync structure */ priv->data.lst = (xmlNode *)gdome_xmlGetAttrList(parent_priv->n); /* check for a default value and eventually insert it */ defaultvalue = xmlGetProp(parent_priv->n, name->str); if(defaultvalue != NULL) { defaultattr = gdome_xml_n_mkref ((xmlNode *)xmlNewProp(parent_priv->n, name->str, defaultvalue)); xmlFree(defaultvalue); if (gdome_xml_nnm_eventEnabledByCode (self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMAttrModified */ if (defaultattr != NULL) { mev = gdome_evt_mevnt_mkref (); attrName = gdome_xml_n_nodeName (defaultattr, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, defaultattr, NULL, NULL, attrName, GDOME_ADDITION, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_str_unref (attrName); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); gdome_xml_n_unref (defaultattr, exc); } } } if (gdome_xml_nnm_eventEnabledByCode (self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } /* Check for ID removal */ if (xmlIsID(parent_priv->n->doc, parent_priv->n, (xmlAttr *)((Gdome_xml_Node *)ret)->n)) xmlRemoveID(parent_priv->n->doc, (xmlAttr *)((Gdome_xml_Node *)ret)->n); } gdome_xml_n_unref (parent, exc); g_strfreev(strs); return ret; } *exc = GDOME_NOT_FOUND_ERR; return NULL; } /** * gdome_xml_nnm_removeNamedItemNS: * @self: NamedNodeMap Objects ref * @namespaceURI: The namespace URI of the node to remove. * @localName: The local name of the node to remove. * @exc: Exception Object ref * * Removes a node specified by local name and namespace URI. When this map * contains the attributes attached to an element, if the removed attribute * is known to have a default value, an attribute immediately appears * containing the default value as well as the corresponding namespace URI, * local name, and prefix when applicable. * * %GDOME_NOT_FOUND_ERR: Raised if there is no node named @name in this map. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. * Returns: the node removed from this map if a node with such a local name and * namespace URI exists. */ GdomeNode * gdome_xml_nnm_removeNamedItemNS (GdomeNamedNodeMap *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; GdomeNode *ret = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (localName != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (namespaceURI == NULL) return gdome_xml_nnm_removeNamedItem (self, localName, exc); if (priv->accessType == GDOME_READONLY_NODE) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } /* Hash Table */ if (priv->type == GDOME_ENTITY_NODE || priv->type == GDOME_NOTATION_NODE) { xmlHashTable *ht = priv->data.ht; if((ret = gdome_xml_nnm_getNamedItemNS(self, namespaceURI, localName, exc)) != NULL) { xmlHashRemoveEntry2(ht, namespaceURI->str, localName->str, NULL); return ret; } } /* List */ else if (priv->type == GDOME_ATTRIBUTE_NODE) { GdomeNode *parent = gdome_xml_n_mkref (((Gdome_xml_Element *)priv->elem)->n); Gdome_xml_Node *parent_priv = (Gdome_xml_Node *)parent; xmlChar *defaultvalue = NULL; GdomeNode *defaultattr = NULL; GdomeMutationEvent *mev; GdomeDOMString *attrName; if (xmlStrEqual(namespaceURI->str, GDOME_XMLNS_NAMESPACE)) ret = gdome_xml_a_mkref_ns (parent_priv->n, (xmlNs *)gdome_xmlUnlinkNsDecl(parent_priv->n, localName->str)); else ret = gdome_xml_n_mkref ((xmlNode *)gdome_xmlUnlinkNsAttr(parent_priv->n, namespaceURI->str, localName->str)); if(ret != NULL) { if (gdome_xml_nnm_eventEnabledByCode (self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMAttrModified */ mev = gdome_evt_mevnt_mkref (); attrName = gdome_xml_n_nodeName (ret, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, ret, NULL, NULL, attrName, GDOME_REMOVAL, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_str_unref (attrName); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } /* resync structure */ priv->data.lst = (xmlNode *)gdome_xmlGetAttrList(parent_priv->n); /* check for a default value and eventually insert it */ defaultvalue = xmlGetNsProp(parent_priv->n, localName->str, namespaceURI->str); if(defaultvalue != NULL) { defaultattr = gdome_xml_n_mkref ((xmlNode *)xmlNewNsProp(parent_priv->n, gdome_xmlGetNs (((Gdome_xml_Node *)ret)->n), localName->str, defaultvalue)); xmlFree(defaultvalue); if (gdome_xml_nnm_eventEnabledByCode (self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMAttrModified */ if (defaultattr != NULL) { mev = gdome_evt_mevnt_mkref (); attrName = gdome_xml_n_nodeName (defaultattr, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, defaultattr, NULL, NULL, attrName, GDOME_ADDITION, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_str_unref (attrName); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); gdome_xml_n_unref (defaultattr, exc); } } } if (gdome_xml_nnm_eventEnabledByCode (self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } /* Check for ID removal */ if (xmlIsID(parent_priv->n->doc, parent_priv->n, (xmlAttr *)((Gdome_xml_Node*)ret)->n)) xmlRemoveID(parent_priv->n->doc, (xmlAttr *)((Gdome_xml_Node *)ret)->n); } gdome_xml_n_unref (parent, exc); return ret; } *exc = GDOME_NOT_FOUND_ERR; return NULL; } /** * gdome_xml_nnm_setNamedItem: * @self: NamedNodeMap Objects ref * @arg: a node to store in this map. * @exc: Exception Object ref * * Adds a node using its nodeName attribute. If a node with that name is * already present in this map, it is replaced by the new one. * * %GDOME_WRONG_DOCUMENT_ERR: Raised if @arg was created from a different * document than the one that created this map. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. * %GDOME_INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an * attribute of another Element object. The DOM user must explicitly clone * Attr nodes to re-use them in other elements. * Returns: if the new Node replaces an existing node, the replaced Node is * returned, otherwise %NULL is returned. * %GDOME_HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node * doesn't belong in this NamedNodeMap. Examples would include trying to * insert something other than an Attr node into an Element's map of * attributes, or a non-Entity node into the DocumentType's map of Entities. */ GdomeNode * gdome_xml_nnm_setNamedItem (GdomeNamedNodeMap *self, GdomeNode *arg, GdomeException *exc) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; xmlNode *newn = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (arg != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (arg), NULL); g_return_val_if_fail (exc != NULL, NULL); if (((Gdome_xml_Document *)priv->doc)->n != ((Gdome_xml_Node*)arg)->n->doc) { *exc = GDOME_WRONG_DOCUMENT_ERR; return NULL; } if (priv->accessType == GDOME_READONLY_NODE) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } if (priv->type != gdome_xml_n_nodeType (arg, exc)) { *exc = GDOME_HIERARCHY_REQUEST_ERR; return NULL; } newn = ((Gdome_xml_Node*)arg)->n; /* Hash Table */ if(priv->type == GDOME_ENTITY_NODE || priv->type == GDOME_NOTATION_NODE) { xmlHashTable *ht = priv->data.ht; xmlNode *ret = NULL; if((ret = xmlHashLookup(ht, gdome_xmlGetName(newn))) != NULL) { xmlHashUpdateEntry(ht, gdome_xmlGetName(newn), newn, NULL); return (GdomeNode *) gdome_xml_n_mkref(ret); } else { xmlHashAddEntry(ht, gdome_xmlGetName(newn), newn); return NULL; } } /* List */ else if (priv->type == GDOME_ATTRIBUTE_NODE) { GdomeNode *parent = gdome_xml_n_mkref (((Gdome_xml_Element *)priv->elem)->n); Gdome_xml_Node *parent_priv = (Gdome_xml_Node *)parent; GdomeNode *ret = NULL; GdomeMutationEvent *mev; GdomeDOMString *attrName; if(newn->prev || newn->next || (gdome_xmlGetParent(newn) && gdome_xmlGetParent(newn) != parent_priv->n)) { *exc = GDOME_INUSE_ATTRIBUTE_ERR; gdome_xml_n_unref (parent, exc); return NULL; } ret = gdome_xml_n_mkref ((xmlNode *)gdome_xmlUnlinkAttr(parent_priv->n, gdome_xmlGetName(newn))); if (ret != NULL) { if (gdome_xml_nnm_eventEnabledByCode (self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMAttrModified */ mev = gdome_evt_mevnt_mkref (); attrName = gdome_xml_n_nodeName (ret, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, ret, NULL, NULL, attrName, GDOME_REMOVAL, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_str_unref (attrName); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } } gdome_xmlLinkAttr(parent_priv->n, (xmlAttr *)newn); if (gdome_xml_nnm_eventEnabledByCode (self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMAttrModified */ mev = gdome_evt_mevnt_mkref (); gdome_xml_n_ref (arg, exc); attrName = gdome_xml_n_nodeName (arg, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, arg, NULL, NULL, attrName, GDOME_ADDITION, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_str_unref (attrName); gdome_xml_n_unref (arg, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } /* resync structure */ priv->data.lst = (xmlNode *)gdome_xmlGetAttrList(parent_priv->n); if (gdome_xml_nnm_eventEnabledByCode (self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } gdome_xml_n_unref (parent, exc); return ret; } return NULL; } /** * gdome_xml_nnm_setNamedItemNS: * @self: NamedNodeMap Objects ref * @arg: a node to store in this map. The node will later be accessible * using the value of its namespaceURI and localName attributes. * @exc: Exception Object ref * * Adds a node using its namespaceURI and localName. If a node with that * namespace URI and that local name is already present in this map, it is * replaced by the new one * * %GDOME_WRONG_DOCUMENT_ERR: Raised if @arg was created from a different * document than the one that created this map. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. * %GDOME_INUSE_ATTRIBUTE_ERR: Raised if @arg is an Attr that is already an * attribute of another Element object. The DOM user must explicitly clone * Attr nodes to re-use them in other elements. * Returns: If the new Node replaces an existing node the replaced Node is * returned, otherwise null is returned. * %GDOME_HIERARCHY_REQUEST_ERR: Raised if an attempt is made to add a node * doesn't belong in this NamedNodeMap. Examples would include trying to * insert something other than an Attr node into an Element's map of * attributes, or a non-Entity node into the DocumentType's map of Entities. */ GdomeNode * gdome_xml_nnm_setNamedItemNS (GdomeNamedNodeMap *self, GdomeNode *arg, GdomeException *exc) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; xmlNode *newn = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (arg != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (arg), NULL); g_return_val_if_fail (exc != NULL, NULL); if (((Gdome_xml_Document *)priv->doc)->n != ((Gdome_xml_Node*)arg)->n->doc) { *exc = GDOME_WRONG_DOCUMENT_ERR; return NULL; } if (priv->accessType == GDOME_READONLY_NODE) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } if (priv->type != gdome_xml_n_nodeType (arg, exc)) { *exc = GDOME_HIERARCHY_REQUEST_ERR; return NULL; } newn = ((Gdome_xml_Node*)arg)->n; /* Hash Table */ if(priv->type == GDOME_ENTITY_NODE || priv->type == GDOME_NOTATION_NODE) { xmlHashTable *ht = priv->data.ht; xmlNode *ret = NULL; if((ret = xmlHashLookup2(ht, gdome_xmlGetName(newn), gdome_xmlGetNsURI(newn))) != NULL) { xmlHashUpdateEntry2(ht, gdome_xmlGetName(newn), gdome_xmlGetNsURI(newn), newn, NULL); return (GdomeNode *) gdome_xml_n_mkref(ret); } else { xmlHashAddEntry2(ht, gdome_xmlGetName(newn), gdome_xmlGetNsURI(newn), newn); return NULL; } } /* List */ else if (priv->type == GDOME_ATTRIBUTE_NODE) { GdomeNode *parent = gdome_xml_n_mkref (((Gdome_xml_Element *)priv->elem)->n); Gdome_xml_Node *parent_priv = (Gdome_xml_Node *)parent; GdomeNode *ret = NULL; GdomeMutationEvent *mev; GdomeDOMString *attrName; if(newn->prev || newn->next || (gdome_xmlGetParent(newn) && gdome_xmlGetParent(newn) != parent_priv->n)) { *exc = GDOME_INUSE_ATTRIBUTE_ERR; gdome_xml_n_unref (parent, exc); return NULL; } ret = gdome_xml_n_mkref ((xmlNode *)gdome_xmlUnlinkNsAttr(parent_priv->n, gdome_xmlGetNsURI(newn), gdome_xmlGetName(newn))); if (ret != NULL) { if (gdome_xml_nnm_eventEnabledByCode (self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMAttrModified */ mev = gdome_evt_mevnt_mkref (); attrName = gdome_xml_n_nodeName (ret, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, ret, NULL, NULL, attrName, GDOME_REMOVAL, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_str_unref (attrName); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } } gdome_xmlLinkAttr(parent_priv->n, (xmlAttr *)newn); if (gdome_xml_nnm_eventEnabledByCode (self, DOM_ATTR_MODIFIED_EVENT_TYPE)) { /* Fire DOMAttrModified */ mev = gdome_evt_mevnt_mkref (); gdome_xml_n_ref (arg, exc); attrName = gdome_xml_n_nodeName (arg, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_ATTR_MODIFIED_EVENT_TYPE, TRUE, FALSE, arg, NULL, NULL, attrName, GDOME_ADDITION, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_str_unref (attrName); gdome_xml_n_unref (arg, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } /* resync structure */ priv->data.lst = (xmlNode *)gdome_xmlGetAttrList(parent_priv->n); if (gdome_xml_nnm_eventEnabledByCode (self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } gdome_xml_n_unref (parent, exc); return ret; } return NULL; } GdomeBoolean gdome_xml_nnm_eventEnabledByCode (GdomeNamedNodeMap *self, guint32 code) { Gdome_xml_NamedNodeMap *priv = (Gdome_xml_NamedNodeMap *)self; g_return_val_if_fail (priv != NULL, FALSE); return gdome_xml_doc_eventEnabledByCode (priv->doc, code); } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-nodel.c0000664000076400007640000001466207452112010015253 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-nodel.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2000 Anders Carlsson * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 "gdome.h" #include "gdome-refdebug.h" #include #include #include #include "gdome-xml-util.h" #include "gdome-xml-node.h" #include "gdome-xml-nodel.h" #include "gdome-xml-str.h" #include "gdome-xml-xmlutil.h" const GdomeNodeListVtab gdome_xml_nl_vtab = { gdome_xml_nl_ref, gdome_xml_nl_unref, gdome_xml_nl_query_interface, gdome_xml_nl_item, gdome_xml_nl_length }; /** * gdome_xml_nl_mkref: * @root: Node Object root of the subtree wanted * @tagName: name of tags wanted, may be "*" for all nodes or NULL * @tagURI: namespaceURI of the tags wanted, may be "*" for any namespace or NULL * * Returns: a NodeList Objects ref that point to the subtree specified. */ GdomeNodeList * gdome_xml_nl_mkref (GdomeNode *root, GdomeDOMString *tagName, GdomeDOMString *tagURI, GdomeAccessType accessType) { Gdome_xml_NodeList *result = NULL; GdomeException exc; if(root == NULL || (tagURI != NULL && tagName == NULL)) return NULL; result = g_new (Gdome_xml_NodeList, 1); memset(result, 0, sizeof(Gdome_xml_NodeList)); #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)result, GDOME_REFDBG_NODELIST); #endif result->refcnt = 1; gdome_xml_n_ref (root, &exc); result->root = root; if(tagName != NULL) result->tagName = gdome_xml_str_mkref_dup(tagName->str); if(tagURI != NULL) result->tagURI = gdome_xml_str_mkref_dup(tagURI->str); result->accessType = accessType; result->vtab = &gdome_xml_nl_vtab; return (GdomeNodeList *)result; } /** * gdome_xml_nl_ref: * @self: NodeList Object ref * @exc: Exception Object ref * * Increase the reference count of the specified NodeList. */ void gdome_xml_nl_ref (GdomeNodeList *self, GdomeException *exc) { Gdome_xml_NodeList *priv = (Gdome_xml_NodeList *)self; g_return_if_fail (priv != NULL); g_return_if_fail (exc != NULL); priv->refcnt++; } /** * gdome_xml_nl_unref: * @self: NodeList Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified NodeList. Free the NodeList * structure if the specified NodeList will have zero reference. */ void gdome_xml_nl_unref (GdomeNodeList *self, GdomeException *exc) { Gdome_xml_NodeList *priv = (Gdome_xml_NodeList *)self; g_return_if_fail (priv != NULL); g_return_if_fail (exc != NULL); if (--priv->refcnt == 0) { gdome_xml_n_unref (priv->root, exc); if(priv->tagName != NULL) gdome_xml_str_unref(priv->tagName); if(priv->tagURI != NULL) gdome_xml_str_unref(priv->tagURI); #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODELIST); #endif g_free (self); } } /** * gdome_xml_nl_query_interface: * @self: NodeList Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_nl_query_interface (GdomeNodeList *self, const char *interface, GdomeException *exc) { Gdome_xml_NodeList *priv = (Gdome_xml_NodeList *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "NodeList")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_nl_item: * @self: NodeList Object ref * @index: Index into the collection * @exc: Exception Object ref * * Returns: the indexth item in the collection. If @index is greater than or * equal to the number of nodes in the list, this returns %NULL. */ GdomeNode * gdome_xml_nl_item (GdomeNodeList *self, gulong index, GdomeException *exc) { Gdome_xml_NodeList *priv = (Gdome_xml_NodeList *)self; xmlNode *root = NULL; xmlNode *ret = NULL; gulong cur = 0; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (GDOME_XML_IS_LEAF_N (priv->root)) return NULL; root = ((Gdome_xml_Node*)priv->root)->n; if (priv->tagName != NULL && priv->tagURI != NULL) ret = gdome_xmlNamedPreorderTraversal(root, (xmlChar *)priv->tagURI->str, (xmlChar *)priv->tagName->str, &cur, index+1); else if (priv->tagName != NULL && priv->tagURI == NULL) ret = gdome_xmlNamedPreorderTraversal(root, NULL, (xmlChar *)priv->tagName->str, &cur, index+1); else ret = gdome_xmlGetChildrenItem(root, index); return gdome_xml_n_mkref (ret); } /** * gdome_xml_nl_length: * @self: NodeList Object ref * @exc: Exception Object ref * * Returns: the number of nodes in the list. The range of valid child node * indices is 0 to length-1 inclusive. */ gulong gdome_xml_nl_length (GdomeNodeList *self, GdomeException *exc) { Gdome_xml_NodeList *priv = (Gdome_xml_NodeList *)self; xmlNode *root = NULL; gulong ret = 0L; g_return_val_if_fail (priv != NULL, 0L); g_return_val_if_fail (exc != NULL, 0L); if (GDOME_XML_IS_LEAF_N (priv->root)) return 0L; root = ((Gdome_xml_Node*)priv->root)->n; if (priv->tagName != NULL && priv->tagURI != NULL) gdome_xmlNamedCntTreeElements(root, (xmlChar *)priv->tagURI->str, (xmlChar *)priv->tagName->str, &ret); else if (priv->tagName != NULL && priv->tagURI == NULL) gdome_xmlNamedCntTreeElements(root, NULL, (xmlChar *)priv->tagName->str, &ret); else ret = gdome_xmlGetChildrensLength(root); return ret; } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-node.c0000664000076400007640000015375107737315575015135 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-node.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2000 Anders Carlsson * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 #include #include "gdome.h" #include "gdome-events.h" #include "gdome-refdebug.h" #include "gdome-treegc.h" #include #include #include #include #include "gdome-xml-util.h" #include "gdome-xml-xmlmemory.h" #include "gdome-xml-xmlutil.h" #include "gdome-xml-xmldtdutil.h" #include "gdome-xml-str.h" #include "gdome-evt-event.h" #include "gdome-evt-eventl.h" #include "gdome-evt-mevent.h" #include "gdome-evt-propagation.h" #include "gdome-xml-nodel.h" #include "gdome-xml-node.h" #include "gdome-xml-document.h" #include "gdome-xml-element.h" #include "gdome-xml-attribute.h" #include "gdome-xml-cdata.h" #include "gdome-xml-entityref.h" #include "gdome-xml-text.h" #include "gdome-xml-cdatas.h" #include "gdome-xml-comment.h" #include "gdome-xml-entity.h" #include "gdome-xml-pi.h" #include "gdome-xml-notation.h" #include "gdome-xml-documentt.h" #include "gdome-xml-documentf.h" #include "gdome-xml-domimpl.h" #include "gdome-xpath.h" #include "gdome-xml-xpns.h" /* indexed by node type first one is NULL because there is no node type number 0 cf: spec p25 (DOM 1). interface Node. */ const void * gdome_xml_vtabs[] = { NULL, &gdome_xml_el_vtab, &gdome_xml_a_vtab, &gdome_xml_t_vtab, &gdome_xml_cds_vtab, &gdome_xml_er_vtab, &gdome_xml_ent_vtab, &gdome_xml_pi_vtab, &gdome_xml_c_vtab, &gdome_xml_doc_vtab, &gdome_xml_dt_vtab, &gdome_xml_df_vtab, &gdome_xml_not_vtab, &gdome_xml_doc_vtab, &gdome_xml_dt_vtab, NULL, NULL, &gdome_xml_ent_vtab }; /*************** * Virtual Table **************/ const GdomeNodeVtab gdome_xml_n_vtab = { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_n_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent, gdome_xml_n_canAppend }; /* function to get the xmlNode from a GdomeNode */ xmlNode * gdome_xml_n_get_xmlNode (GdomeNode *node) { Gdome_xml_Node *xmlnode; xmlnode = (Gdome_xml_Node *)node; return xmlnode->n; } /*********************************************************** ***** Constructor and Reference Count Implementation ****** ***********************************************************/ /** * gdome_xml_n_mkref: * @n: The libxml node of which a Gdome reference is wanted * * Constructor of the Node structure. * Returns: the reference to the Gdome node wanted. */ GdomeNode * gdome_xml_n_mkref (xmlNode *n) { Gdome_xml_Node *result = NULL; xmlElementType type; if (n == NULL) return NULL; type = n->type; if (n->_private && type != XML_NAMESPACE_DECL) { result = (Gdome_xml_Node *)n->_private; result->refcnt++; } else { switch (type) { case XML_ELEMENT_NODE: case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_ENTITY_REF_NODE: case XML_PI_NODE: case XML_COMMENT_NODE: case XML_NOTATION_NODE: case XML_DOCUMENT_FRAG_NODE: case XML_ATTRIBUTE_NODE: case XML_ENTITY_DECL: /*libxml use this instead of XML_ENTITY_NODE*/ result = g_new (Gdome_xml_Node, 1); result->refcnt = 1; result->vtab = (GdomeNodeVtab *)gdome_xml_vtabs[n->type]; result->super.user_data = NULL; result->n = n; if (type == XML_NOTATION_NODE || type == XML_ENTITY_NODE || type == XML_ENTITY_DECL) result->accessType = GDOME_READONLY_NODE; else result->accessType = GDOME_READWRITE_NODE; result->ll = NULL; n->_private = result; #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)result, GDOME_REFDBG_NODE); #endif gdome_treegc_addNode ((GdomeNode *)result); break; case XML_DOCUMENT_TYPE_NODE: case XML_DTD_NODE: return (GdomeNode *)gdome_xml_dt_mkref ((xmlDtd *)n); case XML_HTML_DOCUMENT_NODE: case XML_DOCUMENT_NODE: return (GdomeNode *)gdome_xml_doc_mkref ((xmlDoc *)n); case XML_NAMESPACE_DECL: return (GdomeNode *)gdome_xml_xpns_mkref ((xmlNs *)n); default: g_warning ("gdome_xml_n_mkref: invalid node type"); break; } } return (GdomeNode *)result; } /** * gdome_xml_n_ref: * @self: Node Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Node. */ void gdome_xml_n_ref (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_N (priv)); g_return_if_fail (exc != NULL); priv->refcnt++; } /** * gdome_xml_n_unref: * @self: Node Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference. */ void gdome_xml_n_unref (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; xmlElementType type; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_N (priv)); g_return_if_fail (exc != NULL); type = gdome_xmlGetType (priv->n); switch (type) { case XML_DOCUMENT_TYPE_NODE: case XML_DTD_NODE: return gdome_xml_dt_unref (self, exc); case XML_DOCUMENT_NODE: return gdome_xml_doc_unref (self, exc); default: if (priv->refcnt > 0) priv->refcnt--; if (priv->refcnt == 0 && priv->ll == NULL) { xmlNode *n = (xmlNode *)priv->n; gdome_treegc_delNode (self); n->_private = NULL; if (type != XML_NOTATION_NODE && type != XML_ENTITY_DECL && n->parent == NULL) gdome_xmlFreeSubtree (n); else { if (type == XML_ATTRIBUTE_NODE) if (gdome_xmlIsNsDecl ((xmlAttr *)n)) gdome_xmlFreeSubtree (n); } #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } } } /** * gdome_xml_n_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_n_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } /************************************** ***** Attributes implementation ****** **************************************/ /** * gdome_xml_n_attributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NamedNodeMap containing the attributes of this node (if it is an * Element) or %NULL otherwise. */ GdomeNamedNodeMap * gdome_xml_n_attributes (GdomeNode *self, GdomeException *exc) { g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (self), NULL); g_return_val_if_fail (exc != NULL, NULL); if (GDOME_XML_IS_EL (self)) return gdome_el_attributes((GdomeElement *)self, exc); return NULL; } /** * gdome_xml_n_childNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: a NodeList that contains all children of this node. If there are no * children, this is a NodeList containing no nodes. Note that attributes are * not considered to be children of element nodes - use gdome_n_attributes to * obtain the attributes. */ GdomeNodeList * gdome_xml_n_childNodes (GdomeNode *self, GdomeException *exc) { g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (self), NULL); g_return_val_if_fail (exc != NULL, NULL); if (GDOME_XML_IS_NS(self)) return NULL; return gdome_xml_nl_mkref ((GdomeNode*)self, NULL, NULL, GDOME_READONLY_NODE); } /** * gdome_xml_n_firstChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the first child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_xml_n_firstChild (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); switch (gdome_xmlGetType (priv->n)) { case XML_DOCUMENT_TYPE_NODE: case XML_DTD_NODE: case XML_PI_NODE: case XML_COMMENT_NODE: case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_NOTATION_NODE: case XML_NAMESPACE_DECL: return NULL; case XML_DOCUMENT_NODE: case XML_DOCUMENT_FRAG_NODE: case XML_ENTITY_REF_NODE: case XML_ELEMENT_NODE: case XML_ATTRIBUTE_NODE: case XML_ENTITY_NODE: case XML_ENTITY_DECL: return gdome_xml_n_mkref (gdome_xmlGetFirstChild (priv->n)); default: g_warning ("gdome_xml_n_firstChild: invalid node type"); return NULL; } } /** * gdome_xml_n_lastChild: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the last child of this node. If there is no such node, * this returns %NULL. */ GdomeNode * gdome_xml_n_lastChild (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); switch (gdome_xmlGetType (priv->n)) { case XML_DOCUMENT_TYPE_NODE: case XML_DTD_NODE: case XML_PI_NODE: case XML_COMMENT_NODE: case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_NOTATION_NODE: case XML_NAMESPACE_DECL: return NULL; case XML_DOCUMENT_NODE: case XML_DOCUMENT_FRAG_NODE: case XML_ENTITY_REF_NODE: case XML_ELEMENT_NODE: case XML_ATTRIBUTE_NODE: case XML_ENTITY_NODE: case XML_ENTITY_DECL: return gdome_xml_n_mkref (gdome_xmlGetLastChild (priv->n)); default: g_warning ("gdome_xml_n_lastChild: invalid node type"); return NULL; } } /** * gdome_xml_n_localName: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the local part of the qualified name of this node. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_xml_n_localName (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if((gdome_xmlGetType(priv->n) == XML_ELEMENT_NODE || gdome_xmlGetType(priv->n) == XML_ATTRIBUTE_NODE) && gdome_xmlGetNs(priv->n) != NULL) return gdome_xml_str_mkref_dup ((gchar *)gdome_xmlGetName (priv->n)); else return NULL; } /** * gdome_xml_n_namespaceURI: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace URI of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_xml_n_namespaceURI (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if((gdome_xmlGetType(priv->n) == XML_ELEMENT_NODE || gdome_xmlGetType(priv->n) == XML_ATTRIBUTE_NODE || gdome_xmlGetType(priv->n) == XML_NAMESPACE_DECL) && gdome_xmlGetNs(priv->n) != NULL) return gdome_xml_str_mkref_dup ((gchar *)gdome_xmlGetNsURI (priv->n)); else return NULL; } /** * gdome_xml_n_nextSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately following this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_xml_n_nextSibling (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if(GDOME_XML_IS_A (priv) || GDOME_XML_IS_NS (priv)) return NULL; else return gdome_xml_n_mkref (gdome_xmlGetNext (priv->n)); } /** * gdome_xml_n_nodeName: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the name of this node, depending on its type. */ GdomeDOMString * gdome_xml_n_nodeName (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; GdomeDOMString *ret = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); switch (gdome_xmlGetType (priv->n)) { case XML_ATTRIBUTE_NODE: ret = gdome_a_name((GdomeAttr *)self, exc); break; case XML_ELEMENT_NODE: ret = gdome_el_tagName((GdomeElement *)self, exc); break; case XML_DOCUMENT_TYPE_NODE: case XML_DTD_NODE: ret = gdome_dt_name((GdomeDocumentType *)self, exc); break; case XML_PI_NODE: ret = gdome_pi_target((GdomeProcessingInstruction *)self, exc); break; case XML_ENTITY_NODE: case XML_ENTITY_DECL: /*libxml use this instead of XML_ENTITY_NODE*/ case XML_ENTITY_REF_NODE: case XML_NOTATION_NODE: ret = gdome_xml_str_mkref_dup((gchar *)gdome_xmlGetName (priv->n)); break; case XML_CDATA_SECTION_NODE: ret = gdome_xml_str_mkref_dup("#cdata-section"); break; case XML_COMMENT_NODE: ret = gdome_xml_str_mkref_dup("#comment"); break; case XML_DOCUMENT_NODE: ret = gdome_xml_str_mkref_dup("#document"); break; case XML_DOCUMENT_FRAG_NODE: ret = gdome_xml_str_mkref_dup("#document-fragment"); break; case XML_TEXT_NODE: ret = gdome_xml_str_mkref_dup("#text"); break; case XML_NAMESPACE_DECL: ret = gdome_xml_str_mkref_dup(gdome_xmlGetNsPrefix(priv->n)); break; default: g_warning ("gdome_n_name: wrong Node Type."); } return ret; } /** * gdome_xml_n_nodeType: * @self: Node Object ref * @exc: Exception Object ref * * Returns: an integer bigger than %0 representing the type of the underlying * object or %0 on error. */ unsigned short gdome_xml_n_nodeType (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; xmlElementType type; g_return_val_if_fail (priv != NULL, 0); g_return_val_if_fail (GDOME_XML_IS_N (priv), 0); g_return_val_if_fail (exc != NULL, 0); type = gdome_xmlGetType(priv->n); if (type == XML_DTD_NODE) return XML_DOCUMENT_TYPE_NODE; else if (type == XML_ENTITY_DECL) return XML_ENTITY_NODE; else if (type == XML_NAMESPACE_DECL) return GDOME_XPATH_NAMESPACE_NODE; else return type; } /** * gdome_xml_n_nodeValue: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the value of this node, depending on its type. */ GdomeDOMString * gdome_xml_n_nodeValue (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; GdomeDOMString *ret = NULL; g_return_val_if_fail (priv != NULL, 0); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (exc != NULL, 0); switch (gdome_xmlGetType (priv->n)) { case XML_ATTRIBUTE_NODE: ret = gdome_a_value ((GdomeAttr *)self, exc); break; case XML_PI_NODE: ret = gdome_pi_data ((GdomeProcessingInstruction *)self, exc); break; case XML_CDATA_SECTION_NODE: case XML_COMMENT_NODE: case XML_TEXT_NODE: ret = gdome_xml_str_mkref_own (xmlNodeGetContent (priv->n)); break; case XML_ELEMENT_NODE: case XML_ENTITY_NODE: case XML_ENTITY_REF_NODE: case XML_DOCUMENT_NODE: case XML_DOCUMENT_TYPE_NODE: case XML_DOCUMENT_FRAG_NODE: case XML_NOTATION_NODE: case XML_DTD_NODE: case XML_ENTITY_DECL: case XML_NAMESPACE_DECL: break; default: g_warning ("could not recognize the Node Type."); } return ret; } /** * gdome_xml_n_ownerDocument: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the documment object associated with this node. This is also the * Document object used to create new nodes. When this node is a Document or a * DocumentType which is not used with any Document yet, this is %NULL. */ GdomeDocument * gdome_xml_n_ownerDocument (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if (gdome_xmlGetType (priv->n) == XML_DOCUMENT_NODE) return NULL; else return (GdomeDocument *)gdome_xml_n_mkref ((xmlNode *)gdome_xmlGetOwner (priv->n)); } /** * gdome_xml_n_parentNode: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the parent of this node. All nodes, except Attr, * Document, DocumentFragment, Entity, and Notation may have a parent. However, * if a node has just been created and not yet added to the tree, or if it has * been removed from the tree, this is %NULL. */ GdomeNode * gdome_xml_n_parentNode (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if(GDOME_XML_IS_TREE_N (priv)) return gdome_xml_n_mkref (gdome_xmlGetParent (priv->n)); else return NULL; } /** * gdome_xml_n_prefix: * @self: Node Objects ref * @exc: Exception Object ref * * Returns: the namespace prefix of this node, or %NULL if it is unspecified. * For nodes of any type other than %GDOME_ELEMENT_NODE and * %GDOME_ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, this is * always %NULL. */ GdomeDOMString * gdome_xml_n_prefix (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, 0); g_return_val_if_fail (GDOME_XML_IS_N (priv), 0); g_return_val_if_fail (exc != NULL, 0); if((gdome_xmlGetType(priv->n) == XML_ELEMENT_NODE || gdome_xmlGetType(priv->n) == XML_ATTRIBUTE_NODE || gdome_xmlGetType(priv->n) == XML_NAMESPACE_DECL) && gdome_xmlGetNs(priv->n) != NULL) return gdome_xml_str_mkref_dup ((gchar *)gdome_xmlGetNsPrefix (priv->n)); else return NULL; } /** * gdome_xml_n_previousSibling: * @self: Node Object ref * @exc: Exception Object ref * * Returns: the node immediately preceding this node. If there is no such * node, this returns %NULL. */ GdomeNode * gdome_xml_n_previousSibling (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if(GDOME_XML_IS_A (priv) || GDOME_XML_IS_NS (priv)) return NULL; else return gdome_xml_n_mkref (gdome_xmlGetPrev (priv->n)); } /** * gdome_xml_n_set_nodeValue: * @self: Node Object ref * @nodeValue: The new value for this node. * @exc: Exception Object ref * * Sets The value of this node, depending on its type. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_xml_n_set_nodeValue (GdomeNode *self, GdomeDOMString *nodeValue, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_N (priv)); g_return_if_fail (nodeValue != NULL); g_return_if_fail (exc != NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } switch (gdome_xmlGetType(priv->n)) { case XML_ATTRIBUTE_NODE: gdome_xml_a_set_value ((GdomeAttr *)self, nodeValue, exc); break; case XML_PI_NODE: gdome_xml_pi_set_data ((GdomeProcessingInstruction *)self, nodeValue, exc); break; case XML_CDATA_SECTION_NODE: case XML_COMMENT_NODE: case XML_TEXT_NODE: gdome_xml_cd_set_data ((GdomeCharacterData *)self, nodeValue, exc); break; case XML_ELEMENT_NODE: case XML_ENTITY_NODE: case XML_ENTITY_REF_NODE: case XML_DOCUMENT_NODE: case XML_DOCUMENT_TYPE_NODE: case XML_DOCUMENT_FRAG_NODE: case XML_NOTATION_NODE: case XML_DTD_NODE: case XML_NAMESPACE_DECL: break; default: g_warning ("could not recognize the Node Type."); } } /** * gdome_xml_n_set_prefix: * @self: Node Object ref * @prefix: The new prefix for this node. * @exc: Exception Object ref * * Sets a new nemaspace prefix for this node. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * %GDOME_NAMESPACE_ERR: Raised if the specified @prefix is malformed per the * Namespaces in XML specification, if the namespaceURI of this node is %NULL, * if the specified prefix is "xml" and the namespaceURI of this node is * different from "http://www.w3.org/XML/1998/namespace", if this node is an * attribute and the specified prefix is "xmlns" and the namespaceURI of this * node is different from "http://www.w3.org/2000/xmlns/", or if this node is * an attribute and the qualifiedName of this node is "xmlns". */ void gdome_xml_n_set_prefix (GdomeNode *self, GdomeDOMString *prefix, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; xmlNs *ns; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_N (priv)); g_return_if_fail (prefix != NULL); g_return_if_fail (exc != NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } if((gdome_xmlGetType(priv->n) == XML_ELEMENT_NODE || gdome_xmlGetType(priv->n) == XML_ATTRIBUTE_NODE) && gdome_xmlGetNs(priv->n) != NULL && !xmlStrEqual(gdome_xmlGetNsPrefix (priv->n), (xmlChar *)prefix->str)) { /* tests for NAMESPACE_ERR */ gchar *nsURI = (gchar *)gdome_xmlGetNsURI (priv->n); if (nsURI == NULL || (!strcmp (prefix->str, "xml") && strcmp (nsURI, "http://www.w3.org/XML/1998/namespace")) || (gdome_xmlGetType(priv->n) == XML_ATTRIBUTE_NODE && !strcmp (prefix->str, "xmlns") && strcmp (nsURI, GDOME_XMLNS_NAMESPACE)) || (gdome_xmlGetType(priv->n) == XML_ATTRIBUTE_NODE && !strcmp (gdome_xmlGetName(priv->n), "xmlns"))) { *exc = GDOME_NAMESPACE_ERR; return; } ns = gdome_xmlNewNs (priv->n->doc, gdome_xmlGetNsURI (priv->n), (xmlChar *)prefix->str); gdome_xmlSetNs(priv->n, ns); } } /************************************** ******* Methods implementation ******* **************************************/ /** * gdome_xml_n_appendChild: * @self: Node Object ref * @newChild: The node to add * @exc: Exception Object ref * * Adds the node @newChild to the end of the list of children of this node. * If the @newChild is already in the tree, it is first removed. If it is a * DocumentFragment node, the entire contents of the document fragment are * moved into the child list of this node * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to append is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node added. */ GdomeNode * gdome_xml_n_appendChild (GdomeNode *self, GdomeNode *newChild, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; Gdome_xml_Node *new_priv = (Gdome_xml_Node *)newChild; GdomeMutationEvent *mev; xmlNode *ret; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (new_priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (new_priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if (!gdome_xml_n_canAppend (self, newChild, exc)) { *exc = GDOME_HIERARCHY_REQUEST_ERR; return NULL; } if (gdome_xmlGetOwner(new_priv->n) != gdome_xmlGetOwner(priv->n)) { *exc = GDOME_WRONG_DOCUMENT_ERR; return NULL; } if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } /* If the newChild is already in the tree, it is first removed. */ if (gdome_xmlGetParent(new_priv->n) != NULL) gdome_xmlUnlinkChild(gdome_xmlGetParent(new_priv->n), new_priv->n); ret = gdome_xmlAppendChild(priv->n, new_priv->n); /* Delete children list for DocumentFragment Node */ if (gdome_xmlGetType (new_priv->n) == XML_DOCUMENT_FRAG_NODE) { gdome_xmlSetFirstChild(new_priv->n, NULL); gdome_xmlSetLastChild(new_priv->n, NULL); } if (gdome_xml_n_eventEnabledByCode (self, DOM_NODE_INSERTED_EVENT_TYPE)) { /* Fire DOMNodeInserted */ mev = gdome_evt_mevnt_mkref (); gdome_xml_n_ref (self, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_NODE_INSERTED_EVENT_TYPE, TRUE, FALSE, self, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (newChild, (GdomeEvent *)mev, exc); gdome_xml_n_unref (self, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if (gdome_xml_n_eventEnabledByCode (self, DOM_NODE_INSERTED_INTO_DOCUMENT_EVENT_TYPE)) { /* Fire DOMNodeInsertedIntoDocument */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_NODE_INSERTED_INTO_DOCUMENT_EVENT_TYPE, FALSE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (newChild, (GdomeEvent *)mev, exc); gdome_xml_n_subTreeDispatchEvent (newChild, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if (gdome_xml_n_eventEnabledByCode (self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (self, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } return gdome_xml_n_mkref (ret); } /** * gdome_xml_n_cloneNode: * @self: Node Object ref * @deep: If true, recursively clone the subtree under the specified node; * if false, clone only the node itself (and its attributes, if it is * an Element). * @exc: Exception Object ref * * Makes a duplicate of this node, i.e., serves as a generic copy * constructor for nodes. The duplicate node has no parent; (parentNode is * %NULL). * %GDOME_DOCUMENT_TYPE_NODE, %GDOME_NOTATION_NODE and %GDOME_ENTITY_NODE * nodes are not supported. * * %GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not * supported. * Returns: the duplicate node. */ GdomeNode * gdome_xml_n_cloneNode (GdomeNode *self, GdomeBoolean deep, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; xmlNode *n = NULL; xmlElementType type; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); type = gdome_xmlGetType (priv->n); if (type == XML_ENTITY_NODE || type == XML_ENTITY_DECL || type == XML_NOTATION_NODE || type == XML_DOCUMENT_TYPE_NODE || type == XML_DTD_NODE || type == XML_NAMESPACE_DECL ) *exc = GDOME_NOT_SUPPORTED_ERR; else if (type == XML_DOCUMENT_NODE) n = (xmlNode *)xmlCopyDoc ((xmlDoc *)priv->n, deep); else if (type == XML_ATTRIBUTE_NODE) { n = (xmlNode *)xmlCopyProp (NULL, (xmlAttr *)priv->n); if (gdome_xmlGetOwner (n) == NULL) gdome_xmlSetOwner (n , gdome_xmlGetOwner (priv->n)); } else n = xmlDocCopyNode (priv->n, gdome_xmlGetOwner(priv->n), deep); if (*exc) return NULL; else return gdome_xml_n_mkref (n); } /** * gdome_xml_n_hasAttributes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any attributes, %FALSE otherwise. */ GdomeBoolean gdome_xml_n_hasAttributes (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, 0); g_return_val_if_fail (GDOME_XML_IS_N (priv), 0); g_return_val_if_fail (exc != NULL, 0); if (GDOME_XML_IS_EL (priv)) return (gdome_xmlGetAttrList (priv->n) != NULL); else return FALSE; } /** * gdome_xml_n_hasChildNodes: * @self: Node Object ref * @exc: Exception Object ref * * Returns: %TRUE if this node has any children, %FALSE otherwise. */ GdomeBoolean gdome_xml_n_hasChildNodes (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; g_return_val_if_fail (priv != NULL, 0); g_return_val_if_fail (GDOME_XML_IS_N (priv), 0); g_return_val_if_fail (exc != NULL, 0); switch (gdome_xmlGetType (priv->n)) { case XML_DOCUMENT_TYPE_NODE: case XML_DTD_NODE: case XML_PI_NODE: case XML_COMMENT_NODE: case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_NOTATION_NODE: case XML_NAMESPACE_DECL: return FALSE; case XML_DOCUMENT_NODE: case XML_DOCUMENT_FRAG_NODE: case XML_ENTITY_REF_NODE: case XML_ELEMENT_NODE: case XML_ATTRIBUTE_NODE: case XML_ENTITY_NODE: case XML_ENTITY_DECL: return (gdome_xmlGetFirstChild (priv->n) != NULL); default: g_warning ("gdome_xml_n_hasChildNodes: invalid node type"); return FALSE; } } /** * gdome_xml_n_insertBefore: * @self: Node Object ref * @newChild: The new node to put in the child list * @refChild: the reference node, i.e., the node before which the new node * must be inserted. * @exc: Exception Object ref * * Inserts the node @newChild before the existing child node @refChild. If * @refChild is %NULL, insert @newChild at the end of the list of children. * If @newChild is a DocumentFragment node, all of its children are inserted, * in the same order, before @refChild. If the @newChild is already in the * tree, it is first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not * allow children of the type of the @newChild node, or if the node to insert is * one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @refChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node being inserted. */ GdomeNode * gdome_xml_n_insertBefore (GdomeNode *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; Gdome_xml_Node *new_priv = (Gdome_xml_Node *)newChild; Gdome_xml_Node *ref_priv = (Gdome_xml_Node *)refChild; GdomeMutationEvent *mev; xmlNode *ret = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (new_priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (new_priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if (!gdome_xml_n_canAppend (self, newChild, exc)) { *exc = GDOME_HIERARCHY_REQUEST_ERR; return NULL; } if (gdome_xmlGetOwner(new_priv->n) != gdome_xmlGetOwner(priv->n)) { *exc = GDOME_WRONG_DOCUMENT_ERR; return NULL; } if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } /* If refChild is null, insert newChild at the end of the list of children.*/ if(ref_priv == NULL) return gdome_xml_n_appendChild (self, newChild, exc); else g_return_val_if_fail (GDOME_XML_IS_N (ref_priv), NULL); /* If the newChild is already in the tree, it is first removed. */ if (gdome_xmlGetParent(new_priv->n) != NULL) { if (gdome_xml_n_eventEnabledByCode (self, DOM_NODE_REMOVED_EVENT_TYPE)) { /* Fire DOMNodeRemoved */ mev = gdome_evt_mevnt_mkref (); gdome_xml_n_ref (self, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_NODE_REMOVED_EVENT_TYPE, TRUE, FALSE, self, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (newChild, (GdomeEvent *)mev, exc); gdome_xml_n_unref (self, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if (gdome_xml_n_eventEnabledByCode (self, DOM_NODE_REMOVED_FROM_DOCUMENT_EVENT_TYPE)) { /* Fire DOMNodeRemovedFromDocument */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_NODE_REMOVED_FROM_DOCUMENT_EVENT_TYPE, FALSE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (newChild, (GdomeEvent *)mev, exc); gdome_xml_n_subTreeDispatchEvent (newChild, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } gdome_xmlUnlinkChild(gdome_xmlGetParent(new_priv->n), new_priv->n); } if ((ret = gdome_xmlInsertBeforeChild(priv->n, new_priv->n, ref_priv->n)) == NULL) { *exc = GDOME_NOT_FOUND_ERR; return NULL; } /* Unlink children list for DocumentFragment Node */ if (gdome_xmlGetType (new_priv->n) == XML_DOCUMENT_FRAG_NODE) { gdome_xmlSetFirstChild(new_priv->n, NULL); gdome_xmlSetLastChild(new_priv->n, NULL); } if (gdome_xml_n_eventEnabledByCode (self, DOM_NODE_INSERTED_EVENT_TYPE)) { /* Fire DOMNodeInserted */ mev = gdome_evt_mevnt_mkref (); gdome_xml_n_ref (self, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_NODE_INSERTED_EVENT_TYPE, TRUE, FALSE, self, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (newChild, (GdomeEvent *)mev, exc); gdome_xml_n_unref (self, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if (gdome_xml_n_eventEnabledByCode (self, DOM_NODE_INSERTED_INTO_DOCUMENT_EVENT_TYPE)) { /* Fire DOMNodeInsertedIntoDocument */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_NODE_INSERTED_INTO_DOCUMENT_EVENT_TYPE, FALSE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (newChild, (GdomeEvent *)mev, exc); gdome_xml_n_subTreeDispatchEvent (newChild, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if (gdome_xml_n_eventEnabledByCode (self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (self, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } return gdome_xml_n_mkref (ret); } /** * gdome_xml_n_isSupported: * @self: Node Object ref * @feature: The name of the feature to test. * @version: This is the version number of the feature to test. In Level 2, * version 1, this is the string "2.0". If the version is not * specified, supporting any version of the feature will cause the * method to return %TRUE. * @exc: Exception Object ref * * Tests whether the DOM implementation implements a specific feature and that * feature is supported by this node. * Returns: %TRUE if the specified feature is supported on this node, %FALSE * otherwise. */ GdomeBoolean gdome_xml_n_isSupported (GdomeNode *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; GdomeBoolean ret; GdomeDOMImplementation *domimpl; g_return_val_if_fail (priv != NULL, FALSE); g_return_val_if_fail (GDOME_XML_IS_N (priv), FALSE); g_return_val_if_fail (feature != NULL, FALSE); g_return_val_if_fail (exc != NULL, FALSE); if (version == NULL) return TRUE; domimpl = gdome_xml_di_mkref(); ret = gdome_xml_di_hasFeature (domimpl, feature, version, exc); gdome_xml_di_unref (domimpl, exc); return ret; } /** * gdome_xml_n_normalize: * @self: Node Object ref * @exc: Exception Object ref * * Puts all Text nodes in the full depth of the sub-tree underneath this Node, * including attribute nodes, into a "normal" form where only structure (e.g., * elements, comments, processing instructions, CDATA sections, and entity * references) separates Text nodes, i.e., there are neither adjacent Text * nodes nor empty Text nodes. */ void gdome_xml_n_normalize (GdomeNode *self, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; GdomeNode *child = NULL, *new_child = NULL; GdomeNode *next = NULL, *new_next = NULL; GdomeDOMString *str = NULL; GdomeNode *result = NULL; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_N (priv)); g_return_if_fail (exc != NULL); /* this is a generic implementation, not optimized for speed */ child = gdome_n_firstChild (self, exc); while (child != NULL) { unsigned short type; type = gdome_n_nodeType (child, exc); if (type == GDOME_TEXT_NODE) { next = gdome_n_nextSibling (child, exc); while (next != NULL) { if (gdome_n_nodeType (next, exc) != GDOME_TEXT_NODE) { gdome_n_unref (next, exc); break; } str = gdome_cd_data ((GdomeCharacterData *)next, exc); gdome_cd_appendData ((GdomeCharacterData *)child, str, exc); gdome_str_unref (str); new_next = gdome_n_nextSibling (next, exc); result = gdome_n_removeChild (self, next, exc); gdome_n_unref (result, exc); gdome_n_unref (next, exc); next = new_next; } } else if (type == GDOME_ELEMENT_NODE) { GdomeNamedNodeMap *nnm; gulong i, n; gdome_n_normalize (child, exc); nnm = gdome_n_attributes (child, exc); n = gdome_nnm_length (nnm, exc); for (i = 0; i < n; i++) { GdomeNode *attr; attr = gdome_nnm_item (nnm, i, exc); gdome_n_normalize (attr, exc); gdome_n_unref (attr, exc); } gdome_nnm_unref (nnm, exc); } new_child = gdome_n_nextSibling (child, exc); gdome_n_unref (child, exc); child = new_child; } } /** * gdome_xml_n_removeChild: * @self: Node Object ref * @oldChild: The node being removed * @exc: Exception Object ref * * Removes the child node indicated by @oldChild from the list of children, and * returns it. * * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node removed. */ GdomeNode * gdome_xml_n_removeChild (GdomeNode *self, GdomeNode *oldChild, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; Gdome_xml_Node *old_priv = (Gdome_xml_Node *)oldChild; GdomeMutationEvent *mev; xmlNode *ret; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (priv), NULL); g_return_val_if_fail (old_priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_TREE_N (old_priv), NULL); g_return_val_if_fail (exc != NULL, NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } if (gdome_xml_n_eventEnabledByCode (self, DOM_NODE_REMOVED_EVENT_TYPE)) { /* Fire DOMNodeRemoved */ mev = gdome_evt_mevnt_mkref (); gdome_xml_n_ref (self, exc); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_NODE_REMOVED_EVENT_TYPE, TRUE, FALSE, self, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (oldChild, (GdomeEvent *)mev, exc); gdome_xml_n_unref (self, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if (gdome_xml_n_eventEnabledByCode (self, DOM_NODE_REMOVED_FROM_DOCUMENT_EVENT_TYPE)) { /* Fire DOMNodeRemovedFromDocument */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_NODE_REMOVED_FROM_DOCUMENT_EVENT_TYPE, FALSE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (oldChild, (GdomeEvent *)mev, exc); gdome_xml_n_subTreeDispatchEvent (oldChild, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if (gdome_xml_n_eventEnabledByCode (self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (self, (GdomeEvent *)mev, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if ((ret = gdome_xmlUnlinkChild(priv->n, old_priv->n)) == NULL) { *exc = GDOME_NOT_FOUND_ERR; return NULL; } return gdome_xml_n_mkref (ret); } /** * gdome_xml_n_replaceChild: * @self: Node Object ref * @newChild: The new node to put in the child list * @oldChild: The node being replaced in the list * @exc: Exception Object ref * * Replaces the child node @oldChild with @newChild in the list of children, * and returns the @oldChild node. If @newChild is a DocumentFragment object, * @oldChild is replaced by all of the DocumentFragment children, which are * inserted in the same order. If the @newChild is already in the tree, it is * first removed. * * %GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does * not allow children of the type of the @newChild node, or if the node to put * in is one of this node's ancestors or this node itself. * %GDOME_WRONG_DOCUMENT_ERR: Raised if @newChild was created from a different * document than the one that created this node. * %GDOME_NOT_FOUND_ERR: Raised if @oldChild is not a child of this node. * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. * Returns: the node replaced. */ GdomeNode * gdome_xml_n_replaceChild (GdomeNode *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc) { GdomeNode *ret = NULL; GdomeNode *refChild = NULL; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (self), NULL); g_return_val_if_fail (newChild != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (newChild), NULL); g_return_val_if_fail (oldChild != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_N (oldChild), NULL); g_return_val_if_fail (exc != NULL, NULL); if (GDOME_ISREADONLY (self)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return NULL; } refChild = gdome_n_nextSibling (oldChild, exc); if (gdome_n_removeChild (self, oldChild, exc)) { if (gdome_n_insertBefore (self, newChild, refChild, exc)) { gdome_n_unref (newChild, exc); ret = oldChild; } else { gdome_n_unref (oldChild, exc); ret = NULL; } } if (refChild) gdome_n_unref (refChild, exc); return ret; } /** * gdome_xml_n_addEventListener: * @self: Node Object ref * @type: the event type for which the user is registering * @listener: the listener parameter takes an interface implemented by the * user which contains the methods to be called when the event occurs. * @useCapture: if %TRUE, useCapture indicates that the user wishes to initiate * capture. After initiating capture, all events of the specified * type will be dispatched to the registered EventListener before * being dispatched to any EventTargets beneath them in the tree. * Events which are bubbling upward through the tree will not * trigger an EventListener designated to use capture. * @exc: Exception Object ref * * This method allows the registration of event listeners on the event target. * If an EventListener is added to an EventTarget while it is processing an * event, it will not be triggered by the current actions but may be triggered * during a later stage of event flow, such as the bubbling phase. * If multiple identical EventListeners are registered on the same EventTarget * with the same parameters the duplicate instances are discarded. They do not * cause the EventListener to be called twice and since they are discarded * they do not need to be removed with the removeEventListener method. */ void gdome_xml_n_addEventListener (GdomeNode *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; Gdome_xml_ListenerList *ll = NULL; Gdome_xml_ListenerList *temp; guint32 codeType; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_N (priv)); g_return_if_fail (listener != NULL); g_return_if_fail (type != NULL); g_return_if_fail (exc != NULL); /* duplicate instances are discarted */ codeType = gdome_evt_evnt_codeOfName (type->str); temp = priv->ll; while (temp) { if (temp->listener == listener && temp->type == codeType && temp->useCapture == useCapture) { return; } temp = temp->next; } /* create a new ListenerList entry*/ ll = g_new (Gdome_xml_ListenerList, 1); ll->type = codeType; gdome_evt_evntl_ref (listener, exc); ll->listener = listener; ll->useCapture = useCapture; /* add it at begin of the ListenerList of the target */ ll->next = priv->ll; priv->ll = ll; } /** * gdome_xml_n_removeEventListener: * @self: Node Object ref * @type: Specifies the event type of the EventListener being removed. * @listener: The EventListener parameter indicates the EventListener to be * removed. * @useCapture: Specifies whether the EventListener being removed was * registered as a capturing listener or not. If a listener was * registered twice, one with capture and one without, each must * be removed separately. Removal of a capturing listener does * not affect a non-capturing version of the same listener, and * vice versa. * @exc: Exception Object ref * * This method allows the removal of event listeners from the event target. If * an EventListener is removed from an EventTarget while it is processing an * event, it will not be triggered by the current actions. EventListeners can * never be invoked after being removed. Calling removeEventListener with * arguments which do not identify any currently registered EventListener on * the EventTarget has no effect. */ void gdome_xml_n_removeEventListener (GdomeNode *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; Gdome_xml_ListenerList *temp, *prev = NULL; guint32 codeType; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_N (priv)); g_return_if_fail (listener != NULL); g_return_if_fail (type != NULL); g_return_if_fail (exc != NULL); codeType = gdome_evt_evnt_codeOfName (type->str); temp = priv->ll; while (temp) { if (useCapture == temp->useCapture && temp->listener == listener && temp->type == codeType) { if (prev) prev->next = temp->next; else { g_assert (priv->ll == temp); priv->ll = priv->ll->next; } temp->next = NULL; gdome_evt_evntl_unref (listener, exc); g_free (temp); break; } prev = temp; temp = temp->next; } } /** * gdome_xml_n_dispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is the EventTarget on which dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. * Returns: if preventDefault was called the value is %FALSE, else the value * is %TRUE. */ GdomeBoolean gdome_xml_n_dispatchEvent (GdomeNode *self, GdomeEvent *evt, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; Gdome_evt_Event *ev_priv = (Gdome_evt_Event *)evt; g_return_val_if_fail (priv != NULL, FALSE); g_return_val_if_fail (GDOME_XML_IS_N (priv), FALSE); g_return_val_if_fail (evt != NULL, FALSE); g_return_val_if_fail (exc != NULL, FALSE); if (ev_priv->type == 0) { *exc = GDOME_EVENT_EXCEPTION + GDOME_UNSPECIFIED_EVENT_TYPE_ERR; return FALSE; } gdome_xml_n_ref (self, exc); ev_priv->target = self; gdome_evt_fireEvent (evt); gdome_xml_n_unref (self, exc); return !ev_priv->default_prevented; } /** * gdome_xml_n_subTreeDispatchEvent: * @self: Node Object ref * @evt: Specifies the event type, behavior, and contextual information to be * used in processing the event. * @exc: Exception Object ref * * This method allows the dispatch of events into the implementations event * model. Events dispatched in this manner will have the same capturing and * bubbling behavior as events dispatched directly by the implementation. The * target of the event is any nodes in the subtree of the EventTarget on which * dispatchEvent is called. * * GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not * specified by initializing the event before dispatchEvent was called. * Specification of the Event's type as %NULL or an empty string will also * trigger this exception. */ void gdome_xml_n_subTreeDispatchEvent (GdomeNode *self, GdomeEvent *evt, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; GdomeNode *child, *temp; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_N (priv)); g_return_if_fail (evt != NULL); g_return_if_fail (exc != NULL); child = gdome_xml_n_firstChild (self, exc); while (child) { gdome_xml_n_dispatchEvent (child, evt, exc); gdome_xml_n_subTreeDispatchEvent (child, evt, exc); temp = gdome_xml_n_nextSibling (child, exc); gdome_xml_n_unref (child, exc); child = temp; } } /** * gdome_xml_n_canAppend: * @self: Node Object ref * @newChild: The Node Object ref of the node to test * @exc: Exception Object ref * * Tests if a @newChild can be added in the child list of this node. * Returns: %TRUE if @newChild can be added, %FALSE otherwise. */ GdomeBoolean gdome_xml_n_canAppend (GdomeNode *self, GdomeNode *newChild, GdomeException *exc) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; Gdome_xml_Node *new_priv = (Gdome_xml_Node *)newChild; xmlElementType new_type; GdomeBoolean ret = TRUE; g_return_val_if_fail (priv != NULL, FALSE); g_return_val_if_fail (GDOME_XML_IS_N (priv), FALSE); g_return_val_if_fail (new_priv != NULL, FALSE); g_return_val_if_fail (GDOME_XML_IS_N (new_priv), FALSE); g_return_val_if_fail (exc != NULL, FALSE); /* Check if self can have a child of newChild type */ new_type = gdome_xmlGetType (new_priv->n); if (new_type == XML_DOCUMENT_FRAG_NODE) return TRUE; switch (gdome_xmlGetType (priv->n)) { case XML_DOCUMENT_TYPE_NODE: case XML_DTD_NODE: case XML_PI_NODE: case XML_COMMENT_NODE: case XML_TEXT_NODE: case XML_CDATA_SECTION_NODE: case XML_NOTATION_NODE: ret = FALSE; break; case XML_DOCUMENT_NODE: /* Element (max of one), ProcessingInstruction, Comment, DocumentType (max of one) */ if ((new_type != XML_ELEMENT_NODE && new_type != XML_PI_NODE && new_type != XML_COMMENT_NODE && new_type != XML_DTD_NODE && new_type != XML_DOCUMENT_TYPE_NODE) || (new_type == XML_ELEMENT_NODE && xmlDocGetRootElement ((xmlDoc *)priv->n) != NULL) || ((new_type == XML_DTD_NODE || new_type == XML_DOCUMENT_TYPE_NODE) && ((xmlDoc *)priv->n)->intSubset != NULL)) ret = FALSE; break; case XML_DOCUMENT_FRAG_NODE: case XML_ENTITY_REF_NODE: case XML_ELEMENT_NODE: case XML_ENTITY_NODE: case XML_ENTITY_DECL: /* Element, ProcessingInstruction, Comment, Text, CDATASection, EntityReference */ if (new_type != XML_ELEMENT_NODE && new_type != XML_PI_NODE && new_type != XML_COMMENT_NODE && new_type != XML_TEXT_NODE && new_type != XML_CDATA_SECTION_NODE && new_type != XML_ENTITY_REF_NODE) ret = FALSE; break; case XML_ATTRIBUTE_NODE: /* Text, EntityReference */ if (new_type != XML_TEXT_NODE && new_type != XML_ENTITY_REF_NODE) ret = FALSE; break; default: g_warning ("gdome_xml_n_canAppend: invalid node type"); ret = FALSE; break; } /* Check if newChild is an ancestor of self */ if (ret) { xmlNode *p = priv->n; while (p != NULL) { if (p == new_priv->n) { ret = FALSE; break; } p = gdome_xmlGetParent (p); } } return ret; } /** * gdome_xml_n_eventEnabledByCode: * @self: Node Objects ref * @code: The event type to check * * Returns: TRUE if the specified event type is enabled */ GdomeBoolean gdome_xml_n_eventEnabledByCode (GdomeNode *self, guint32 code) { Gdome_xml_Node *priv = (Gdome_xml_Node *)self; GdomeException exc = 0; GdomeDocument *doc; GdomeBoolean res; g_return_val_if_fail (priv != NULL, FALSE); g_return_val_if_fail (GDOME_XML_IS_N (priv), FALSE); doc = gdome_xml_doc_mkref (gdome_xmlGetOwnerOrSelf (priv->n)); g_assert(doc != NULL); res = gdome_xml_doc_eventEnabledByCode (doc, code); gdome_doc_unref(doc, &exc); g_assert(exc == 0); return res; } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-pi.c0000664000076400007640000001517507705757472014616 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-pi.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include "gdome.h" #include "gdome-events.h" #include #include #include #include "gdome-xml-util.h" #include "gdome-xml-str.h" #include "gdome-xml-node.h" #include "gdome-xml-xmlutil.h" #include "gdome-evt-event.h" #include "gdome-evt-mevent.h" #include "gdome-evt-propagation.h" #include "gdome-xml-pi.h" #include "gdome-xml-document.h" const GdomeProcessingInstructionVtab gdome_xml_pi_vtab = { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_pi_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_pi_target, gdome_xml_pi_data, gdome_xml_pi_set_data }; /** * gdome_xml_pi_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_pi_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_ProcessingInstruction *priv = (Gdome_xml_ProcessingInstruction *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_PI (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "ProcessingInstruction") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_pi_target: * @self: ProcessingInstruction Object ref * @exc: Exception Object ref * * Returns: the target of this processing instruction. XML defines this as being * the first token following the markup that begins the processing instruction. */ GdomeDOMString * gdome_xml_pi_target (GdomeProcessingInstruction *self, GdomeException *exc) { Gdome_xml_ProcessingInstruction *priv = (Gdome_xml_ProcessingInstruction *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_PI (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); return gdome_xml_str_mkref_dup((gchar *)gdome_xmlGetName (priv->n)); } /** * gdome_xml_pi_data: * @self: ProcessingInstruction Object ref * @exc: Exception Object ref * * Returns: the content of this processing instruction. This is from the first * non white space character after the target to the character immediately * preceding the %?>. */ GdomeDOMString * gdome_xml_pi_data (GdomeProcessingInstruction *self, GdomeException *exc) { Gdome_xml_ProcessingInstruction *priv = (Gdome_xml_ProcessingInstruction *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_PI (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); return gdome_xml_str_mkref_own (xmlNodeGetContent (priv->n)); } /** * gdome_xml_pi_set_data: * @self: ProcessingInstruction Object ref * @data: The string of data to be set * @exc: Exception Object ref * * Set the content of this processing instruction. * * %GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. */ void gdome_xml_pi_set_data (GdomeProcessingInstruction *self, GdomeDOMString *data, GdomeException *exc) { Gdome_xml_ProcessingInstruction *priv = (Gdome_xml_ProcessingInstruction *)self; GdomeMutationEvent *mev; GdomeDOMString *prevValue; GdomeNode *parent; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_PI (priv)); g_return_if_fail (data != NULL); g_return_if_fail (exc != NULL); if (GDOME_ISREADONLY (priv)) { *exc = GDOME_NO_MODIFICATION_ALLOWED_ERR; return; } xmlNodeSetContent (priv->n, (xmlChar *)data->str); if (gdome_xml_n_eventEnabledByCode ((GdomeNode *) self, DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE)) { /* Fire DOMCharacterDataModified */ mev = gdome_evt_mevnt_mkref (); prevValue = gdome_xml_pi_data (self, exc); gdome_str_ref (data); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, prevValue, data, NULL, 0, exc); gdome_xml_n_dispatchEvent ((GdomeNode *)self, (GdomeEvent *)mev, exc); gdome_xml_str_unref (data); gdome_xml_str_unref (prevValue); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } if (gdome_xml_n_eventEnabledByCode ((GdomeNode *) self, DOM_SUBTREE_MODIFIED_EVENT_TYPE)) { /* Fire DOMSubtreeModified */ parent = gdome_xml_n_mkref (gdome_xmlGetParent (priv->n)); if (parent != NULL) { mev = gdome_evt_mevnt_mkref (); gdome_evt_mevnt_initMutationEventByCode (mev, DOM_SUBTREE_MODIFIED_EVENT_TYPE, TRUE, FALSE, NULL, NULL, NULL, NULL, 0, exc); gdome_xml_n_dispatchEvent (parent, (GdomeEvent *)mev, exc); gdome_xml_n_unref (parent, exc); gdome_evt_mevnt_unref ((GdomeEvent *)mev, exc); } } } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-notation.c0000664000076400007640000001040507452112010015774 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-notation.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include "gdome.h" #include #include #include #include #include "gdome-xml-util.h" #include "gdome-xml-xmldtdutil.h" #include "gdome-xml-str.h" #include "gdome-xml-node.h" #include "gdome-xml-notation.h" const GdomeNotationVtab gdome_xml_not_vtab = { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_not_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_not_publicId, gdome_xml_not_systemId }; /** * gdome_xml_not_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_not_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_Notation *priv = (Gdome_xml_Notation *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_NOT (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "Notation") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_not_publicId: * @self: Notations Object ref * @exc: Exception Object ref * * Returns: the public identifier of this notation. If the public identifier * was not specified, this is NULL. */ GdomeDOMString * gdome_xml_not_publicId (GdomeNotation *self, GdomeException *exc) { Gdome_xml_Notation *priv = (Gdome_xml_Notation *)self; gdome_xmlNotation *not; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_NOT(priv), NULL); g_return_val_if_fail (exc != NULL, NULL); not = priv->n; return gdome_xml_str_mkref_dup (not->PublicID); } /** * gdome_xml_not_systemId: * @self: Notations Object ref * @exc: Exception Object ref * * Returns: the system identifier of this notation. If the system identifier * was not specified, this is NULL. */ GdomeDOMString * gdome_xml_not_systemId (GdomeNotation *self, GdomeException *exc) { Gdome_xml_Notation *priv = (Gdome_xml_Notation *)self; gdome_xmlNotation *not; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_NOT(priv), NULL); g_return_val_if_fail (exc != NULL, NULL); not = priv->n; return gdome_xml_str_mkref_dup (not->SystemID); } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-entity.c0000664000076400007640000001241607452112010015461 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-entity.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include "gdome.h" #include #include #include #include #include "gdome-xml-util.h" #include "gdome-xml-xmlutil.h" #include "gdome-xml-str.h" #include "gdome-xml-node.h" #include "gdome-xml-entity.h" const GdomeEntityVtab gdome_xml_ent_vtab = { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_ent_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_ent_publicId, gdome_xml_ent_systemId, gdome_xml_ent_notationName }; /** * gdome_xml_ent_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_ent_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_Entity *priv = (Gdome_xml_Entity *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_ENT (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "Entity") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_xml_ent_publicId: * @self: The Entity Object ref * @exc: The Exception Object ref * * Returns: the public identifier associated with the entity, if specified. * If the public identifier was not specified, this is %NULL. */ GdomeDOMString * gdome_xml_ent_publicId (GdomeEntity *self, GdomeException *exc) { Gdome_xml_Entity *priv = (Gdome_xml_Entity *)self; xmlEntity *ent = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_ENT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); ent = priv->n; if (ent->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) return NULL; else return gdome_xml_str_mkref_dup((gchar *)ent->ExternalID); } /** * gdome_xml_ent_systemId: * @self: The Entity Object ref * @exc: The Exception Object ref * * Returns: the system identifier associated with the entity, if specified. * If the system identifier was not specified, this is %NULL. */ GdomeDOMString * gdome_xml_ent_systemId (GdomeEntity *self, GdomeException *exc) { Gdome_xml_Entity *priv = (Gdome_xml_Entity *)self; xmlEntity *ent = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_ENT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); ent = priv->n; if (ent->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) return NULL; else return gdome_xml_str_mkref_dup((gchar *)ent->SystemID); } /** * gdome_xml_ent_notationName: * @self: The Entity Object ref * @exc: The Exception Object ref * * Returns: for unparsed entities, the name of the notation for the entity. * For parsed entities, this is %NULL. */ GdomeDOMString * gdome_xml_ent_notationName (GdomeEntity *self, GdomeException *exc) { Gdome_xml_Entity *priv = (Gdome_xml_Entity *)self; xmlEntity *ent = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_ENT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); ent = priv->n; if (ent->etype != XML_EXTERNAL_GENERAL_UNPARSED_ENTITY) return NULL; else return gdome_xml_str_mkref_dup((gchar *)gdome_xmlGetContent((xmlNode *)ent)); } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-xmlutil.c0000664000076400007640000006112107737315575015673 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-xmlutil.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* NOTE This file contains some functions that work directly on the gnome-xml tree structure. So if something change we'll have to work only on this module. */ #include #include #include #include #include #include "gdome.h" #include "gdome-xml-xmlutil.h" #ifndef INLINE /** * gdome_xmlGetPrevChild: * @node: the node of which the previous sibling is wanted * * Returns: the previous child of the node specified. */ xmlNode * gdome_xmlGetPrev(xmlNode *node) { if (node == NULL) return NULL; return node->prev; } /** * gdome_xmlSetPrev: * @node: the node of which the previous sibling is to be set * @prev: the node to set as previous * * Sets prev as the previous sibling of node */ void gdome_xmlSetPrev(xmlNode *node, xmlNode *prev) { if (node == NULL) return; node->prev = prev; } /** * gdome_xmlGetNextChild: * @node: the node of which the next child is wanted * * Returns: the next child of the node specified. */ xmlNode * gdome_xmlGetNext(xmlNode *node) { if (node == NULL) return NULL; return node->next; } /** * gdome_xmlSetNext: * @node: the node of which the next sibling is to be set * @prev: the node to set as next * * Sets next as the next sibling of node */ void gdome_xmlSetNext(xmlNode *node, xmlNode *next) { if (node == NULL) return; node->next= next; } /** * gdome_xmlGetFirstChild: * @node: the node of which the first child is wanted * * Returns: the first child of the node specified. */ xmlNode * gdome_xmlGetFirstChild(xmlNode *node) { if (node == NULL) return NULL; return node->children; } /** * gdome_xmlSetLastChild: * @node: the node of which the last child is to be set * @last: the node to set as last child * * Sets @last as the last child of @node. */ void gdome_xmlSetFirstChild (xmlNode *node, xmlNode *first) { if (node == NULL) return; node->children = first; } /** * gdome_xmlGetLastChild: * @node: the node of which the last child is wanted * * Returns: the last child of the node specified. */ xmlNode * gdome_xmlGetLastChild(xmlNode *node) { if (node == NULL) return NULL; return node->last; } /** * gdome_xmlSetLastChild: * @node: the node of which the last child is to be set * @last: the node to set as last child * * Sets @last as the last child of @node. */ void gdome_xmlSetLastChild (xmlNode *node, xmlNode *last) { if (node == NULL) return; node->last = last; } /** * gdome_xmlGetAttrList: * @elem: the element node of which the attribute list is wanted * * Returns: the first attribute of the list. */ xmlAttr * gdome_xmlGetAttrList(xmlNode *elem) { if (elem == NULL) return NULL; return elem->properties; } /** * gdome_xmlGetNsDeclList: * @elem: the element node of which the namespace decl list is wanted * * Returns: the first namespace of the list. */ xmlNs * gdome_xmlGetNsDeclList(xmlNode *elem) { if (elem == NULL) return NULL; return elem->nsDef; } /** * gdome_xmlSetAttrList: * @elem: the element of node which the attribute list is to be set * @attr: the attribute that has to start the list * * Set the attribute list of the element specified to attr */ void gdome_xmlSetAttrList(xmlNode *elem, xmlAttr *attr) { if(elem == NULL) return; elem->properties = attr; } #endif /* INLINE */ /** * gdome_xmlSetNsDeclList: * @elem: the element of node which the attribute list is to be set * @attr: the namespace declarationattribute that has to start the list * * Set the namespace definition list of the element specified to * attr */ void gdome_xmlSetNsDeclList(xmlNode *elem, xmlChar *prefix, xmlChar *href) { xmlNs * ns; if(elem == NULL) return; ns = xmlNewNs(elem, href, prefix); elem->nsDef = ns; } #ifndef INLINE /** * gdome_xmlGetOwner: * @node: the node of which the owner document is wanted * * Returns: the document that owns the node specified. */ xmlDoc * gdome_xmlGetOwner(xmlNode *node) { if (node == NULL) return NULL; return node->doc; } #endif /* INLINE */ /** * gdome_xmlGetOwnerOrSelf: * @node: the node of which the owner document is wanted * * Returns: the document that owns the node specified, * or the node itself if it turns out to be the document node */ xmlDoc * gdome_xmlGetOwnerOrSelf(xmlNode *node) { if (node == NULL) return NULL; if (gdome_xmlGetType(node) == XML_DOCUMENT_NODE) return (xmlDoc *) node; else return gdome_xmlGetOwner(node); } #ifndef INLINE /** * gdome_xmlSetOwner: * @node: the node of which the owner document is to be set * * Set the owner of @node. */ void gdome_xmlSetOwner(xmlNode *node, xmlDoc *owner) { if (node == NULL) return; node->doc = owner; } /** * gdome_xmlGetParent: * @node: the node of which the parent node is wanted * * Returns: the parent of the node specified. */ xmlNode * gdome_xmlGetParent(xmlNode *node) { if (node == NULL) return NULL; return node->parent; } /** * gdome_xmlSetParent: * @node: the node of which the parent is to be set * @parent: the parent to set * * Set the parent of @node. */ void gdome_xmlSetParent(xmlNode *node, xmlNode *parent) { if (node == NULL) return; node->parent = parent; } #endif /* INLINE */ /** * gdome_xmlGetNsPrefix: * @node: the node of which the prefix is wanted * * Returns: the prefix of the node specified or %NULL if the node has no * prefix. */ const xmlChar * gdome_xmlGetNsPrefix(xmlNode *node) { if (node == NULL || node->ns == NULL) return NULL; return node->ns->prefix; } /** * gdome_xmlGetNsURI: * @node: the node of which the namespaceURI is wanted * * Returns: the namespaceURI of the node specified or %NULL if the node * has no namespace. */ const xmlChar * gdome_xmlGetNsURI(xmlNode *node) { if (node == NULL || node->ns == NULL) return NULL; return node->ns->href; } #ifndef INLINE /** * gdome_xmlGetNs: * @node: the node of which the namespace is wanted * * Returns: the namespace of the node specified or %NULL if the node * has no namespace. */ xmlNs * gdome_xmlGetNs(xmlNode *node) { if (node == NULL) return NULL; return node->ns; } /** * gdome_xmlSetNs: * @node: the node of which the namespace is to be set * @ns: the namespace to set * * Set @ns as namespace for @node */ void gdome_xmlSetNs (xmlNode *node, xmlNs *ns) { if (node == NULL || ns == NULL) return; node->ns = ns; } /** * gdome_xmlGetType: * @node: the node of which the type is wanted * * Returns: the type of the node specified. */ xmlElementType gdome_xmlGetType(xmlNode *node) { if (node == NULL) return 0; return node->type; } /** * gdome_xmlGetContent: * @node: the node of which the content is wanted * * Returns: the content of the node specified. */ xmlChar * gdome_xmlGetContent(xmlNode *node) { if (node == NULL) return NULL; return node->content; } /** * gdome_xmlGetName: * @node: the node of which the name is wanted * * Returns: the name of the node specified. */ const xmlChar * gdome_xmlGetName(xmlNode *node) { if (node == NULL) return NULL; return node->name; } #endif /* INLINE */ /** * gdome_xmlGetAttr: * @elem: the element node where find the attribute to unlink * @name: the name of attribute to search * * Get the attribute specified by @name if exists. * Returns: the attribute if found, otherwise %NULL */ xmlAttr * gdome_xmlGetAttr(xmlNode *elem, const xmlChar* name) { xmlAttr *cur = NULL; if(elem == NULL || name == NULL) return NULL; for(cur = elem->properties; cur && !xmlStrEqual(name, gdome_xmlGetName((xmlNode *)cur)); cur = cur->next); return cur; } /** * gdome_xmlGetNsAttr: * @elem: the element node where find the attribute to unlink * @namespaceURI: the namespace URI of attribute to search * @localName: the local name of the attribute to search * * Get the attribute specified by @namespaceURI and its * @localName, if exists. * Returns: the attribute if found, %NULL otherwise. */ xmlAttr * gdome_xmlGetNsAttr(xmlNode *elem, const xmlChar* namespaceURI, const xmlChar* localName) { xmlAttr *cur = NULL; if(elem == NULL || namespaceURI == NULL || localName == NULL) return NULL; for(cur = elem->properties; cur != NULL && (!xmlStrEqual(localName, gdome_xmlGetName((xmlNode *)cur)) || ((cur->ns != NULL && !xmlStrEqual(namespaceURI, gdome_xmlGetNsURI((xmlNode *)cur))) || cur->ns == NULL)); cur = cur->next); return cur; } /** * gdome_xmlSetAttrValue: * @attr: the attribute which the value is to be set * @value: the value to set * * Set a new value to an Attribute node. */ void gdome_xmlSetAttrValue(xmlAttr *attr, xmlChar *value) { if(attr == NULL) return; if (attr->children != NULL) xmlFreeNodeList(attr->children); attr->children = NULL; attr->last = NULL; if (value != NULL) { xmlChar *buffer; xmlNode *tmp; buffer = xmlEncodeEntitiesReentrant(attr->doc, value); attr->children = xmlStringGetNodeList(attr->doc, buffer); attr->last = NULL; tmp = attr->children; for(tmp = attr->children; tmp != NULL; tmp = tmp->next) { tmp->parent = (xmlNode *)attr; tmp->doc = attr->doc; if (tmp->next == NULL) attr->last = tmp; } xmlFree (buffer); } return; } /** * gdome_xmlUnlinkChild: * @parent: the node that owns the node to unlink * @child: the node to unlink * * Unlink the node specified, if exists * Returns: the unlinked node if found, otherwise %NULL */ xmlNode * gdome_xmlUnlinkChild(xmlNode *parent, xmlNode* child) { if(parent == NULL || child == NULL) return NULL; if(gdome_xmlGetParent(child) != parent) return NULL; if (child->prev) child->prev->next = child->next; else parent->children = child->next; if (child->next) child->next->prev = child->prev; else parent->last = child->prev; child->prev = child->next = NULL; child->parent = NULL; return child; } /** * gdome_xmlAppendChild: * @parent: the node that where append the child * @child: the node to append * * Append @child at the end of the @parent children * list. If @child is a %XML_DOCUMENT_FRAG_NODE, all its childrens * are appended at the end of the @parent children list. * Returns: the appended node. */ xmlNode * gdome_xmlAppendChild(xmlNode *parent, xmlNode* child) { xmlNode *iter; if (parent == NULL || child == NULL) return NULL; if (child->type == XML_DOCUMENT_FRAG_NODE) { if (child->children != NULL && child->last != NULL) { for (iter = child->children; iter != NULL; iter = iter->next) iter->parent = parent; if (parent->last) { parent->last->next = child->children; child->children->prev = parent->last; } else { parent->children = child->children; child->children->prev = NULL; } parent->last = child->last; child->last->next = NULL; } } else { if (parent->last) { parent->last->next = child; child->prev = parent->last; } else { parent->children = child; child->prev = NULL; } parent->last = child; child->next = NULL; child->parent = parent; } return child; } /** * gdome_xmlInsertBeforeChild: * @parent: the node where insert the child * @newchild: the node to add * @refchild: the node before which the new node must be inserted. * * Inserts @newchild before @refchild in the * @parent list of childrens. If @newchild is a * %XML_DOCUMENT_FRAG_NODE, all its childrens are inserted before * @refchild in the @parent list of childrens. * Returns: the inserted node or %NULL if @refchild doesn't belong to * @parent. */ xmlNode * gdome_xmlInsertBeforeChild(xmlNode *parent, xmlNode* newchild, xmlNode *refchild) { xmlNode *iter; if (parent == NULL || newchild == NULL || refchild == NULL) return NULL; if (gdome_xmlGetParent(refchild) != parent) return NULL; if (newchild->type == XML_DOCUMENT_FRAG_NODE) { if (newchild->children != NULL && newchild->last != NULL) { for (iter = newchild->children; iter != NULL; iter = iter->next) iter->parent = parent; if (refchild->prev) { refchild->prev->next = newchild->children; newchild->children->prev = refchild->prev; } else { parent->children = newchild->children; newchild->children->prev = NULL; } refchild->prev = newchild->last; newchild->last->next = refchild; } } else { if (refchild->prev) { refchild->prev->next = newchild; newchild->prev = refchild->prev; } else { parent->children = newchild; newchild->prev = NULL; } refchild->prev = newchild; newchild->next = refchild; newchild->parent = parent; } return newchild; } /** * gdome_xmlUnlinkAttr: * @elem: the element node where find the attribute to unlink * @name: the name of attribute to search * * Unlink the attribute specified by @name, if an attribute with * such name exists in @elem. * Returns: the attribute unlinked if found, otherwise %NULL. */ xmlAttr * gdome_xmlUnlinkAttr(xmlNode *elem, const xmlChar* name) { xmlAttr *cur = NULL; if(elem == NULL || name == NULL) return NULL; cur = gdome_xmlGetAttr(elem, name); if(cur) { if (cur->prev) cur->prev->next = cur->next; else elem->properties = cur->next; if (cur->next) cur->next->prev = cur->prev; cur->prev = cur->next = NULL; cur->parent = NULL; } return cur; } /** * gdome_xmlUnlinkNsAttr: * @elem: the element node where find the attribute to unlink * @namespaceURI: the namespace URI of attribute to search * @localName: the local name of the attribute to search * * Unlink the attribute specified by @namespaceURI and its * @localName, if an attribute with such a local name and * namespace URI exists in @elem. * Returns: the attribute unlinked if found, %NULL otherwise. */ xmlAttr * gdome_xmlUnlinkNsAttr(xmlNode *elem, const xmlChar* namespaceURI, const xmlChar* localName) { xmlAttr *cur = NULL; if(elem == NULL || namespaceURI == NULL || localName == NULL) return NULL; cur = gdome_xmlGetNsAttr(elem, namespaceURI, localName); if(cur) { if (cur->prev) cur->prev->next = cur->next; else elem->properties = cur->next; if (cur->next) cur->next->prev = cur->prev; cur->prev = cur->next = NULL; cur->parent = NULL; return cur; } return NULL; } /** * gdome_xmlUnlinkNsDecl: * @elem: the element node where find the attribute to unlink * @localName: the name of attribute to search * * Unlink the attribute specified by @name, if an attribute with * such name exists in @elem. * Returns: the attribute unlinked if found, otherwise %NULL. */ xmlNs * gdome_xmlUnlinkNsDecl(xmlNode *elem, const xmlChar* localName) { xmlNs *cur = NULL; xmlNs *prev = NULL; if(elem == NULL) return NULL; if (localName == NULL || xmlStrEqual(localName, "")) { cur = elem->nsDef; while (cur != NULL) { if (cur->prefix == NULL) { if (prev) prev->next = cur->next; else elem->nsDef = cur->next; cur->next = NULL; return cur; } prev = cur; cur = cur->next; } } else { cur = elem->nsDef; while (cur != NULL) { if (cur->prefix != NULL && xmlStrEqual(localName, cur->prefix)) { if (prev) prev->next = cur->next; else elem->nsDef = cur->next; cur->next = NULL; return cur; } prev = cur; cur = cur->next; } } return NULL; } /** * gdome_xmlLinkAttr: * @elem: the element node where add the attribute * @attr: the attribute to add * * Link @attribute to the @elem. * Returns: -1 if fails, 0 otherwise. */ int gdome_xmlLinkAttr(xmlNode *elem, xmlAttr *attr) { xmlAttr *cur = NULL; if (elem == NULL || attr == NULL) return -1; gdome_xmlSetParent((xmlNode *)attr, (xmlNode *)elem); gdome_xmlSetOwner((xmlNode *)attr, gdome_xmlGetOwner(elem)); if(gdome_xmlGetAttrList(elem) == NULL) { gdome_xmlSetAttrList(elem, attr); return 0; } else { for(cur = gdome_xmlGetAttrList(elem); cur->next != NULL; cur = cur->next); cur->next = attr; attr->prev = cur; return 0; } } /** * gdome_xmlLinkNsDecl: * @elem: the element node where add the namespace declaration * @attr: the namespace declaration attribute to add * * Link @attr to the @elem. * Returns: -1 if fails, 0 otherwise. */ int gdome_xmlLinkNsDecl(xmlNode *elem, xmlChar *prefix, xmlChar *href) { xmlNs *cur = NULL; xmlNs * ns; if (elem == NULL) return -1; if(gdome_xmlGetNsDeclList(elem) == NULL) { gdome_xmlSetNsDeclList(elem, prefix, href); return 0; } else { for(cur = gdome_xmlGetNsDeclList(elem); cur->next != NULL; cur = cur->next); ns = xmlNewNs(elem, href, prefix); cur->next = ns; return 0; } } /** * gdome_xmlGetChildrenItem: * @parent: The node of which the children this is to be scan * @index: The index of the children wanted * * Returns: the index-th children of the parent specified. */ xmlNode * gdome_xmlGetChildrenItem (xmlNode *parent, gulong index) { xmlNode *ret = NULL; gulong cur; for(ret = parent->children, cur = 0; ret != NULL && cur < index; cur++, ret = ret->next); return ret; } /** * gdome_xmlNamedPreorderTraversal: * @root: The root node of the subtree to scan * @tagURI: the namespaceURI of the nodes to select or NULL if no namespace * check is wanted * @tagName: the localName of the nodes to select * @cur: The current node counter (must be 0L) * @index: The index of node wanted * * Returns: the index-th node of the subtree with the localName and nameSpace * specified. */ xmlNode * gdome_xmlNamedPreorderTraversal (xmlNode *root, xmlChar *tagURI, xmlChar *tagName, gulong *cur, gulong index) { xmlNode *iter, *ret = NULL; iter = root->children; if (*cur == index) return root; else if (iter == NULL) return NULL; while(iter != NULL && *curtype == XML_ELEMENT_NODE && (xmlStrEqual(gdome_xmlGetName(iter), tagName) || xmlStrEqual(tagName, "*"))) { if(tagURI != NULL && (xmlStrEqual(gdome_xmlGetNsURI(iter), tagURI) || xmlStrEqual(tagURI, "*"))) (*cur)++; else if(tagURI == NULL) (*cur)++; } ret = gdome_xmlNamedPreorderTraversal(iter, tagURI, tagName, cur, index); if(ret == NULL) iter = iter->next; } return ret; } /** * gdome_xmlGetChildrensLength: * @parent: The node of which the length of the children list is wanted * * Returns: the length of the children list of the node specified. */ gulong gdome_xmlGetChildrensLength (xmlNode *parent) { xmlNode *iter = NULL; gulong ret; for(iter = parent->children, ret = 0; iter != NULL; ret++, iter = iter->next); return ret; } /** * gdome_xmlNamedCntTreeElementes: * @root: The root node of the subtree to scan * @tagURI: the namespaceURI of the nodes to select or NULL if no namespace * check is wanted * @tagName: the localName of the nodes to select * @cur: The current node counter (must be %0L) * * Sets in @cur the length of thr subtree specified. */ void gdome_xmlNamedCntTreeElements (xmlNode *root, xmlChar *tagURI, xmlChar *tagName, gulong *cur) { xmlNode *iter; iter = root->children; if (iter == NULL) return; while(iter != NULL) { if(iter->type == XML_ELEMENT_NODE && (xmlStrEqual(gdome_xmlGetName(iter), tagName) || xmlStrEqual(tagName, "*"))) { if(tagURI != NULL && (xmlStrEqual(gdome_xmlGetNsURI(iter), tagURI) || xmlStrEqual(tagURI, "*"))) (*cur)++; else if(tagURI == NULL) (*cur)++; } gdome_xmlNamedCntTreeElements (iter, tagURI, tagName, cur); iter = iter->next; } return; } /* * gdome_xmlGetNsDecl: * @elem: Element on which to look for namespace declaration attribute * @name: namespace declaration prefix * * Similar to xmlGetProp, but gets the namespace declaration attributes. * Note that expects name to not include 'xmlns' string */ xmlNs * gdome_xmlGetNsDecl (xmlNode *node, xmlChar *localName) { xmlNsPtr cur; xmlNs *ret = NULL; if (node == NULL) return NULL; if (localName == NULL || xmlStrEqual(localName, "")) { cur = node->nsDef; while (cur != NULL) { if (cur->prefix == NULL) { ret = cur; break; } cur = cur->next; } } else { cur = node->nsDef; while (cur != NULL) { if (cur->prefix != NULL && xmlStrEqual(localName, cur->prefix)) { ret = cur; break; } cur = cur->next; } } return ret; } /* * gdome_xmlNewNsDecl * @node: The holding node * @prefix: namespace declaration prefix * @value: namespace URI * * Similar to xmlNewProp, but does not attach attribute to owner element's * children. */ xmlAttrPtr gdome_xmlNewNsDecl(xmlNodePtr node, const xmlChar *prefix, const xmlChar *value) { xmlAttrPtr cur; xmlDocPtr doc = NULL; /* * Allocate a new property and fill the fields. */ cur = (xmlAttrPtr) xmlMalloc(sizeof(xmlAttr)); if (cur == NULL) { xmlGenericError(xmlGenericErrorContext, "xmlNewProp : malloc failed\n"); return(NULL); } memset(cur, 0, sizeof(xmlAttr)); cur->type = XML_ATTRIBUTE_NODE; cur->parent = node; if (node != NULL) { doc = node->doc; cur->doc = doc; } if (prefix == NULL) { cur->name = g_strdup("xmlns"); } else { cur->name = g_strdup(prefix); cur->ns = gdome_xmlNewNs (doc, GDOME_XMLNS_NAMESPACE, "xmlns"); } if (value != NULL) { xmlChar *buffer; xmlNodePtr tmp; buffer = xmlEncodeEntitiesReentrant(doc, value); cur->children = xmlStringGetNodeList(doc, buffer); cur->last = NULL; tmp = cur->children; while (tmp != NULL) { tmp->parent = (xmlNodePtr) cur; tmp->doc = doc; if (tmp->next == NULL) cur->last = tmp; tmp = tmp->next; } xmlFree(buffer); } return(cur); } /* * gdome_xmlIsNsDecl: * @a: Attribute node * * Returns %TRUE if attribute is namespace declaration node, %FALSE otherwise. */ GdomeBoolean gdome_xmlIsNsDecl (xmlAttr *a) { if (xmlStrEqual(a->name, "xmlns")) return 1; if (a->ns != NULL) if (xmlStrEqual(a->ns->href, GDOME_XMLNS_NAMESPACE)) return 1; return 0; } /* * gdome_xmlGetNsDeclByAttr: * @a: Attribute Node * * Get pointer to namespace node corresponding to namespace declaration * attribute. Used by getUserData and setUserData. */ xmlNs * gdome_xmlGetNsDeclByAttr (xmlAttr *a) { if (a->ns == NULL && xmlStrEqual(a->name, "xmlns")) return gdome_xmlGetNsDecl(a->parent, NULL); else if (a->ns != NULL && xmlStrEqual(a->ns->href, GDOME_XMLNS_NAMESPACE)) return gdome_xmlGetNsDecl(a->parent, (xmlChar *)a->name); else return NULL; } /* * gdome_xmlSetOldNs: * @doc: Document node * @ns: Namespace node * * Adds namespace node to libxml's oldNs structure, so that it will * get freed when the document is freed. */ void gdome_xmlSetOldNs (xmlDoc *doc, xmlNs *ns) { /* xmlNs *cur; */ if (doc == NULL) return; if (doc->oldNs == NULL) { /* * Allocate a new Namespace and fill the fields. */ doc->oldNs = (xmlNsPtr) xmlMalloc(sizeof(xmlNs)); if (doc->oldNs == NULL) { xmlGenericError(xmlGenericErrorContext, "xmlSearchNsByHref : malloc failed\n"); return; } memset(doc->oldNs, 0, sizeof(xmlNs)); doc->oldNs->type = XML_LOCAL_NAMESPACE; doc->oldNs->href = xmlStrdup(XML_XML_NAMESPACE); doc->oldNs->prefix = xmlStrdup((const xmlChar *)"xml"); } ns->next = doc->oldNs; doc->oldNs = ns; /* cur = doc->oldNs; while (cur->next != NULL) { cur = cur->next; } cur->next = ns; */ } xmlNs* gdome_xmlNewNs (xmlDoc *doc, const xmlChar *href, const xmlChar *prefix) { xmlNs *cur; g_return_val_if_fail (doc != NULL, NULL); g_return_val_if_fail (href != NULL, NULL); cur = doc->oldNs; while (cur != NULL && ((cur->prefix == NULL && prefix != NULL) || (cur->prefix != NULL && prefix == NULL) || !xmlStrEqual (cur->prefix, prefix)) && !xmlStrEqual (cur->href, href)) cur = cur->next; if (cur == NULL) { cur = xmlNewNs (NULL, href, prefix); cur->next = doc->oldNs; doc->oldNs = cur; } return cur; } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-cdatas.c0000664000076400007640000000655307311512647015427 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-cdatas.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "gdome.h" #include "gdome-xml-util.h" #include "gdome-xml-node.h" #include "gdome-xml-cdata.h" #include "gdome-xml-text.h" #include "gdome-xml-cdatas.h" const GdomeCDATASectionVtab gdome_xml_cds_vtab = { { { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_cds_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_cd_data, gdome_xml_cd_set_data, gdome_xml_cd_length, gdome_xml_cd_substringData, gdome_xml_cd_appendData, gdome_xml_cd_insertData, gdome_xml_cd_deleteData, gdome_xml_cd_replaceData }, gdome_xml_t_splitText }, }; /** * gdome_xml_cds_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_cds_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_CDATASection *priv = (Gdome_xml_CDATASection *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_CDS (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "CharacterData") || !strcmp (interface, "Text") || !strcmp (interface, "CDATASection") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-entityref.c0000664000076400007640000000550307311512647016173 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-entityref.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include "gdome.h" #include "gdome-xml-util.h" #include "gdome-xml-node.h" #include "gdome-xml-entityref.h" const GdomeEntityReferenceVtab gdome_xml_er_vtab = { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_er_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent } }; /** * gdome_xml_er_query_interface: * @self: Node Object ref * @interface: interface needed * @exc: Exception Object ref * * Returns: a reference to this object that implements the @interface needed, * or %NULL if the @interface is not supported by this Object. */ gpointer gdome_xml_er_query_interface (GdomeNode *self, const char *interface, GdomeException *exc) { Gdome_xml_EntityReference *priv = (Gdome_xml_EntityReference *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_ER (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Node") || !strcmp (interface, "EntityReference") || !strcmp (interface, "EventTarget")) { priv->refcnt++; return self; } else return NULL; } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-xpns.c0000664000076400007640000000721507452112010015136 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-xpns.c * * CopyRight (C) 2002 T.J. Mather * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 "gdome.h" #include #include "gdome-xml-node.h" #include "gdome.h" #include "gdome-xml-xpns.h" #include "gdome-xml-util.h" #include "gdome-xml-xmlutil.h" #include "gdome-treegc.h" const GdomeXPathNamespaceVtab gdome_xml_xpns_vtab = { { gdome_xml_n_ref, gdome_xml_n_unref, gdome_xml_n_query_interface, gdome_xml_n_nodeName, gdome_xml_n_nodeValue, gdome_xml_n_set_nodeValue, gdome_xml_n_nodeType, gdome_xml_n_parentNode, gdome_xml_n_childNodes, gdome_xml_n_firstChild, gdome_xml_n_lastChild, gdome_xml_n_previousSibling, gdome_xml_n_nextSibling, gdome_xml_n_attributes, gdome_xml_n_ownerDocument, gdome_xml_n_insertBefore, gdome_xml_n_replaceChild, gdome_xml_n_removeChild, gdome_xml_n_appendChild, gdome_xml_n_hasChildNodes, gdome_xml_n_cloneNode, gdome_xml_n_normalize, gdome_xml_n_isSupported, gdome_xml_n_namespaceURI, gdome_xml_n_prefix, gdome_xml_n_set_prefix, gdome_xml_n_localName, gdome_xml_n_hasAttributes, gdome_xml_n_addEventListener, gdome_xml_n_removeEventListener, gdome_xml_n_dispatchEvent, gdome_xml_n_subTreeDispatchEvent }, gdome_xml_xpns_ownerElement }; GdomeXPathNamespace * gdome_xml_xpns_mkref (xmlNs *ns){ Gdome_xml_XPathNamespace *result = NULL; xmlNodePtr n; if (ns == NULL) return NULL; if (ns->type == XML_NAMESPACE_DECL) { n = xmlNewNode(ns, ""); n->type = XML_NAMESPACE_DECL; result = g_new (Gdome_xml_XPathNamespace, 1); result->refcnt = 1; result->vtab = &gdome_xml_xpns_vtab; result->super.user_data = NULL; result->n = n; result->accessType = GDOME_READONLY_NODE; } else { g_warning ("gdome_xml_xpns_mkref: invalid node type"); result = NULL; } return (GdomeXPathNamespace *)result; } /** * gdome_xml_xpns_unref: * @self: XPathNamespace Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Node. Free the Node structure * if the Node will have zero reference */ void gdome_xml_xpns_unref (GdomeNode *self, GdomeException *exc) { Gdome_xml_XPathNamespace *priv = (Gdome_xml_XPathNamespace *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_NS (priv)); g_return_if_fail (exc != NULL); if (priv->refcnt > 0) priv->refcnt--; if (priv->refcnt == 0) { g_free (self); } } /** * gdome_xml_xpns_ownerElement: * @self: XPathNamespace Object ref * @exc: Exception Object ref * * NOT IMPLEMENTED * Returns: %NULL */ GdomeElement * gdome_xml_xpns_ownerElement (GdomeXPathNamespace *self, GdomeException *exc) { /* FIXME libxml's xpath function will have to return node information with namespaces ? */ return NULL; } gdome2-0.8.1/libgdome/gdomecore/gdome-xml-xmldtdutil.h0000664000076400007640000000364307311512647016364 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-xmldtdutil.h * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_XML_XMLNOTATIONS_H #define GDOME_XML_XMLNOTATIONS_H typedef struct _gdome_xmlNotation gdome_xmlNotation; struct _gdome_xmlNotation { void *_private; xmlElementType type; /* XML_NOTATION_NODE */ const xmlChar *name; /* Attribute name */ struct _xmlNode *children; /* NULL */ struct _xmlNode *last; /* NULL */ struct _xmlDtd *parent; /* NULL */ struct _xmlNode *next; /* NULL */ struct _xmlNode *prev; /* NULL */ struct _xmlDoc *doc; /* the containing document */ const xmlChar *PublicID; /* External identifier for PUBLIC */ const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */ struct _xmlNotation *orig; /* the corresponding xmlNotation* */ }; xmlHashTable *gdome_xmlNotationsHashCreate (xmlDoc *doc); void gdome_xmlNotationsHashFree (xmlHashTable *ht); xmlHashTable *gdome_xmlEntitiesHashCreate (xmlDoc *doc); void gdome_xmlEntitiesHashFree (xmlHashTable *ht); #endif /* GDOME_XML_XMLNOTATIONS_H */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-xmlmemory.h0000664000076400007640000000203007376141056016213 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-xmlmemory.h * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_XML_XMLMEMORY_H #define GDOME_XML_XMLMEMORY_H void gdome_xmlFreeSubtree (xmlNode *root); #endif /* GDOME_XML_XMLMEMORY_H */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-util.h0000664000076400007640000001174007435533723015151 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-util.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_XMLUTIL_FILE #define GDOME_XMLUTIL_FILE #include #include "gdome.h" #include "gdome-xml-node.h" #define GDOME_XML_IS_N(node) (\ ((Gdome_xml_Node *) node)->n->type == XML_ELEMENT_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_TEXT_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_CDATA_SECTION_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_ENTITY_REF_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_ENTITY_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_PI_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_COMMENT_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_ATTRIBUTE_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_NOTATION_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_DOCUMENT_TYPE_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_DOCUMENT_FRAG_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_DTD_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_DOCUMENT_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_ENTITY_DECL || \ ((Gdome_xml_Node *) node)->n->type == XML_HTML_DOCUMENT_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_NAMESPACE_DECL ) #define GDOME_XML_IS_TREE_N(node) (\ ((Gdome_xml_Node *) node)->n->type == XML_ELEMENT_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_TEXT_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_CDATA_SECTION_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_ENTITY_REF_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_PI_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_COMMENT_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_DOCUMENT_TYPE_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_DTD_NODE ) #define GDOME_XML_IS_LEAF_N(node) (\ ((Gdome_xml_Node *) node)->n->type == XML_NOTATION_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_TEXT_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_CDATA_SECTION_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_PI_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_COMMENT_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_DOCUMENT_TYPE_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_DTD_NODE ) #define GDOME_XML_IS_DOC(node) (\ ((Gdome_xml_Node *) node)->n->type == XML_DOCUMENT_NODE || \ ((Gdome_xml_Node *) node)->n->type == XML_HTML_DOCUMENT_NODE ) #define GDOME_XML_IS_CD(cd) (\ ((Gdome_xml_Node *) cd)->n->type == XML_CDATA_SECTION_NODE || \ ((Gdome_xml_Node *) cd)->n->type == XML_TEXT_NODE || \ ((Gdome_xml_Node *) cd)->n->type == XML_COMMENT_NODE ) #define GDOME_XML_IS_CDS(cds) (\ ((Gdome_xml_Node *) cds)->n->type == XML_CDATA_SECTION_NODE ) #define GDOME_XML_IS_C(c) (\ ((Gdome_xml_Node *) c)->n->type == XML_COMMENT_NODE ) #define GDOME_XML_IS_T(t) (\ ((Gdome_xml_Node *) t)->n->type == XML_CDATA_SECTION_NODE || \ ((Gdome_xml_Node *) t)->n->type == XML_TEXT_NODE ) #define GDOME_XML_IS_EL(el) (\ ((Gdome_xml_Node *) el)->n->type == XML_ELEMENT_NODE ) #define GDOME_XML_IS_NOT(not) (\ ((Gdome_xml_Node *) not)->n->type == XML_NOTATION_NODE ) #define GDOME_XML_IS_A(a) (\ ((Gdome_xml_Node *) a)->n->type == XML_ATTRIBUTE_NODE ) #define GDOME_XML_IS_DF(df) (\ ((Gdome_xml_Node *) df)->n->type == XML_DOCUMENT_FRAG_NODE ) #define GDOME_XML_IS_NL(cd) 1 #define GDOME_XML_IS_ENT(ent) (\ ((Gdome_xml_Node *) ent)->n->type == XML_ENTITY_NODE || \ ((Gdome_xml_Node *) ent)->n->type == XML_ENTITY_DECL ) #define GDOME_XML_IS_ER(er) (\ ((Gdome_xml_Node *) er)->n->type == XML_ENTITY_REF_NODE ) #define GDOME_XML_IS_PI(pi) (\ ((Gdome_xml_Node *) pi)->n->type == XML_PI_NODE ) #define GDOME_XML_IS_DT(dt) (\ ((Gdome_xml_Node *) dt)->n->type == XML_DTD_NODE || \ ((Gdome_xml_Node *) dt)->n->type == XML_DOCUMENT_TYPE_NODE ) #define GDOME_XML_IS_NS(ns) (\ ((Gdome_xml_Node *) ns)->n->type == XML_NAMESPACE_DECL ) /* Utility Macro */ #define GDOME_ISREADONLY(node) ((Gdome_xml_Node *)node)->accessType == GDOME_READONLY_NODE #endif /* GDOME_XMLUTIL_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-str.h0000664000076400007640000000473307333611170014776 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-str.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_STR_FILE #define GDOME_STR_FILE GdomeDOMString *gdome_xml_str_mkref (const gchar *str); GdomeDOMString *gdome_xml_str_mkref_own (gchar *str); GdomeDOMString *gdome_xml_str_mkref_xml (xmlChar *str); GdomeDOMString *gdome_xml_str_mkref_dup (const gchar *str); void gdome_xml_str_ref (GdomeDOMString *self); void gdome_xml_str_unref (GdomeDOMString *self); GdomeBoolean gdome_xml_str_equal (GdomeDOMString *self, GdomeDOMString *str); GdomeBoolean gdome_xml_str_equalIgnoreCase (GdomeDOMString *self, GdomeDOMString *str); gchar gdome_xml_str_charAt (GdomeDOMString *self, int index); GdomeDOMString * gdome_xml_str_concat (GdomeDOMString *self, GdomeDOMString *str); GdomeBoolean gdome_xml_str_endsWith (GdomeDOMString *self, GdomeDOMString *suffix); GdomeBoolean gdome_xml_str_isEmpty (GdomeDOMString *self); int gdome_xml_str_length (GdomeDOMString *self); GdomeBoolean gdome_xml_str_startsWith (GdomeDOMString *self, GdomeDOMString *prefix); #endif /* GDOME_STR_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-text.h0000664000076400007640000000404007470410747015152 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-text.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* -------------------------------------------------------------- */ /* --------------------------- Text --------------------------- */ /* -------------------------------------------------------------- */ #ifndef GDOME_TEXT_FILE #define GDOME_TEXT_FILE struct _GdomeTextVtab { GdomeCharacterDataVtab super; GdomeText *(*splitText) (GdomeText *self, gulong offset, GdomeException *exc); }; typedef struct _Gdome_xml_Text Gdome_xml_Text; struct _Gdome_xml_Text { GdomeText super; const GdomeTextVtab *vtab; int refcnt; xmlNode *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; extern const GdomeTextVtab gdome_xml_t_vtab; gpointer gdome_xml_t_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); GdomeText * gdome_xml_t_splitText (GdomeText *self, gulong offset, GdomeException *exc); #endif /* GDOME_TEXT_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-comment.h0000664000076400007640000000345707470410747015643 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-comment.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ----------------------------------------------------------------- */ /* --------------------------- Comment --------------------------- */ /* ----------------------------------------------------------------- */ #ifndef GDOME_COMMENT_FILE #define GDOME_COMMENT_FILE struct _GdomeCommentVtab { GdomeCharacterDataVtab super; }; typedef struct _Gdome_xml_Comment Gdome_xml_Comment; struct _Gdome_xml_Comment { GdomeComment super; const GdomeCommentVtab *vtab; int refcnt; xmlNode *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; gpointer gdome_xml_c_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); extern const GdomeCommentVtab gdome_xml_c_vtab; #endif /* GDOME_COMMENT_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-cdata.h0000664000076400007640000001004707470410747015246 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-cdata.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ----------------------------------------------------------------------- */ /* --------------------------- CharacterData --------------------------- */ /* ---- This implements the CharacterData interface of the DOM1 spec ---- */ /* ----------------------------------------------------------------------- */ #ifndef GDOME_CDATA_FILE #define GDOME_CDATA_FILE struct _GdomeCharacterDataVtab { GdomeNodeVtab super; GdomeDOMString *(*data) (GdomeCharacterData *self, GdomeException *exc); void (*set_data) (GdomeCharacterData *self, GdomeDOMString *data, GdomeException *exc); gulong (*length) (GdomeCharacterData *self, GdomeException *exc); GdomeDOMString *(*substringData) (GdomeCharacterData *self, gulong offset, gulong count, GdomeException *exc); void (*appendData) (GdomeCharacterData *self, GdomeDOMString *arg, GdomeException *exc); void (*insertData) (GdomeCharacterData *self, gulong offset, GdomeDOMString *arg, GdomeException *exc); void (*deleteData) (GdomeCharacterData *self, gulong offset, gulong count, GdomeException *exc); void (*replaceData) (GdomeCharacterData *self, gulong offset, gulong count, GdomeDOMString *arg, GdomeException *exc); }; typedef struct _Gdome_xml_CharacterData Gdome_xml_CharacterData; struct _Gdome_xml_CharacterData { GdomeCharacterData super; const GdomeCharacterDataVtab *vtab; int refcnt; xmlNode *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; extern const GdomeCharacterDataVtab gdome_xml_cd_vtab; gpointer gdome_xml_cd_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); GdomeDOMString * gdome_xml_cd_data (GdomeCharacterData *self, GdomeException *exc); void gdome_xml_cd_set_data (GdomeCharacterData *self, GdomeDOMString *data, GdomeException *exc); gulong gdome_xml_cd_length (GdomeCharacterData *self, GdomeException *exc); GdomeDOMString * gdome_xml_cd_substringData (GdomeCharacterData *self, gulong offset, gulong count, GdomeException *exc); void gdome_xml_cd_appendData (GdomeCharacterData *self, GdomeDOMString *arg, GdomeException *exc); void gdome_xml_cd_insertData (GdomeCharacterData *self, gulong offset, GdomeDOMString *arg, GdomeException *exc); void gdome_xml_cd_deleteData (GdomeCharacterData *self, gulong offset, gulong count, GdomeException *exc); void gdome_xml_cd_replaceData (GdomeCharacterData *self, gulong offset, gulong count, GdomeDOMString *arg, GdomeException *exc); #endif /* GDOME_CDATA_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-attribute.h0000664000076400007640000000563407470410747016203 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-attribute.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* -------------------------------------------------------------- */ /* --------------------------- Attr --------------------------- */ /* -------------------------------------------------------------- */ #ifndef GDOME_ATTRIBUTE_FILE #define GDOME_ATTRIBUTE_FILE struct _GdomeAttrVtab { GdomeNodeVtab super; GdomeDOMString *(*name) (GdomeAttr *self, GdomeException *exc); GdomeElement *(*ownerElement) (GdomeAttr *self, GdomeException *exc); GdomeBoolean (*specified) (GdomeAttr *self, GdomeException *exc); GdomeDOMString *(*value) (GdomeAttr *self, GdomeException *exc); void (*set_value) (GdomeAttr *self, GdomeDOMString *value, GdomeException *exc); }; typedef struct _Gdome_xml_Attr Gdome_xml_Attr; struct _Gdome_xml_Attr { GdomeAttr super; const GdomeAttrVtab *vtab; int refcnt; xmlAttr *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; GdomeNode * gdome_xml_a_mkref_ns (xmlNode *node, xmlNs *ns); void gdome_xml_a_unref_ns (GdomeNode *self, GdomeException *exc); gpointer gdome_xml_a_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); GdomeBoolean gdome_xml_a_specified (GdomeAttr *self, GdomeException *exc); GdomeDOMString * gdome_xml_a_name (GdomeAttr *self, GdomeException *exc); GdomeElement * gdome_xml_a_ownerElement (GdomeAttr *self, GdomeException *exc); GdomeDOMString * gdome_xml_a_value (GdomeAttr *self, GdomeException *exc); void gdome_xml_a_set_value (GdomeAttr *self, GdomeDOMString *nodeValue, GdomeException *exc); extern const GdomeAttrVtab gdome_xml_a_vtab; #endif /* GDOME_ATTRIBUTE_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-element.h0000664000076400007640000001601407470410747015623 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-element.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ----------------------------------------------------------------- */ /* --------------------------- Element --------------------------- */ /* ----------------------------------------------------------------- */ #ifndef GDOME_ELEMENT_FILE #define GDOME_ELEMENT_FILE struct _GdomeElementVtab { GdomeNodeVtab super; GdomeDOMString *(*tagName) (GdomeElement *self, GdomeException *exc); GdomeDOMString *(*getAttribute) (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); void (*setAttribute) (GdomeElement *self, GdomeDOMString *name, GdomeDOMString *value, GdomeException *exc); void (*removeAttribute) (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); GdomeAttr *(*getAttributeNode) (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); GdomeAttr *(*setAttributeNode) (GdomeElement *self, GdomeAttr *newAttr, GdomeException *exc); GdomeAttr *(*removeAttributeNode) (GdomeElement *self, GdomeAttr *oldAttr, GdomeException *exc); GdomeNodeList *(*getElementsByTagName) (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); GdomeDOMString *(*getAttributeNS) (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); void (*setAttributeNS) (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeDOMString *value, GdomeException *exc); void (*removeAttributeNS) (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeAttr *(*getAttributeNodeNS) (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeAttr *(*setAttributeNodeNS) (GdomeElement *self, GdomeAttr *newAttr, GdomeException *exc); GdomeNodeList *(*getElementsByTagNameNS) (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeBoolean (*hasAttribute) (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); GdomeBoolean (*hasAttributeNS) (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); }; typedef struct _Gdome_xml_Element Gdome_xml_Element; struct _Gdome_xml_Element { GdomeElement super; const GdomeElementVtab *vtab; int refcnt; xmlNode *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; /* forward declarations */ gpointer gdome_xml_el_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); GdomeDOMString * gdome_xml_el_tagName (GdomeElement *self, GdomeException *exc); GdomeDOMString * gdome_xml_el_getAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); void gdome_xml_el_setAttribute (GdomeElement *self, GdomeDOMString *name, GdomeDOMString *value, GdomeException *exc); void gdome_xml_el_removeAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); GdomeAttr * gdome_xml_el_getAttributeNode (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); GdomeAttr * gdome_xml_el_setAttributeNode (GdomeElement *self, GdomeAttr *newAttr, GdomeException *exc); GdomeAttr * gdome_xml_el_removeAttributeNode (GdomeElement *self, GdomeAttr *oldAttr, GdomeException *exc); GdomeNodeList * gdome_xml_el_getElementsByTagName (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); GdomeDOMString * gdome_xml_el_getAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); void gdome_xml_el_setAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeDOMString *value, GdomeException *exc); void gdome_xml_el_removeAttributeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeAttr * gdome_xml_el_getAttributeNodeNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeAttr * gdome_xml_el_setAttributeNodeNS (GdomeElement *self, GdomeAttr *newAttr, GdomeException *exc); GdomeNodeList * gdome_xml_el_getElementsByTagNameNS (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeNamedNodeMap * gdome_xml_el_attributes (GdomeNode *self, GdomeException *exc); GdomeBoolean gdome_xml_el_hasAttribute (GdomeElement *self, GdomeDOMString *name, GdomeException *exc); GdomeBoolean gdome_xml_el_hasAttributeNs (GdomeElement *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); extern const GdomeElementVtab gdome_xml_el_vtab; #endif /* GDOME_ELEMENT_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-document.h0000664000076400007640000002052707702626141016007 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-document.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_DOC_FILE #define GDOME_DOC_FILE struct _GdomeDocumentVtab { GdomeNodeVtab super; GdomeDocumentType *(*doctype) (GdomeDocument *self, GdomeException *exc); GdomeDOMImplementation *(*implementation) (GdomeDocument *self, GdomeException *exc); GdomeElement *(*documentElement) (GdomeDocument *self, GdomeException *exc); GdomeElement *(*createElement) (GdomeDocument *self, GdomeDOMString *tagName, GdomeException *exc); GdomeDocumentFragment *(*createDocumentFragment) (GdomeDocument *self, GdomeException *exc); GdomeText *(*createTextNode) (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc); GdomeComment *(*createComment) (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc); GdomeCDATASection *(*createCDATASection) (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc); GdomeProcessingInstruction *(*createProcessingInstruction) (GdomeDocument *self, GdomeDOMString *target, GdomeDOMString *data, GdomeException *exc); GdomeAttr *(*createAttribute) (GdomeDocument *self, GdomeDOMString *name, GdomeException *exc); GdomeEntityReference *(*createEntityReference) (GdomeDocument *self, GdomeDOMString *name, GdomeException *exc); GdomeNodeList *(*getElementsByTagName) (GdomeDocument *self, GdomeDOMString *tagname, GdomeException *exc); GdomeNode *(*importNode) (GdomeDocument *self, GdomeNode *importedNode, GdomeBoolean deep, GdomeException *exc); GdomeElement *(*createElementNS) (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); GdomeAttr *(*createAttributeNS) (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); GdomeNodeList *(*getElementsByTagNameNS) (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeElement *(*getElementById) (GdomeDocument *self, GdomeDOMString *elementId, GdomeException *exc); GdomeEvent *(*createEvent) (GdomeDocument *self, GdomeDOMString *eventType, GdomeException *exc); }; typedef struct _Gdome_xml_Document Gdome_xml_Document; struct _Gdome_xml_Document { GdomeDocument super; const GdomeDocumentVtab *vtab; int refcnt; xmlDoc *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; int livenodes; unsigned event_mask; }; void gdome_xml_doc_enableEventByName (GdomeDocument *self, const char *name); void gdome_xml_doc_enableEventByCode (GdomeDocument *self, unsigned int code); void gdome_xml_doc_disableEventByName (GdomeDocument *self, const char *name); void gdome_xml_doc_disableEventByCode (GdomeDocument *self, unsigned int code); GdomeBoolean gdome_xml_doc_eventEnabledByName (GdomeDocument *self, const char *name); GdomeBoolean gdome_xml_doc_eventEnabledByCode (GdomeDocument *self, unsigned int code); GdomeDocument * gdome_xml_doc_mkref (xmlDoc *n); void gdome_xml_doc_unref (GdomeNode *self, GdomeException *exc); gpointer gdome_xml_doc_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); GdomeDocumentType * gdome_xml_doc_doctype (GdomeDocument *self, GdomeException *exc); GdomeDOMImplementation * gdome_xml_doc_implementation (GdomeDocument *self, GdomeException *exc); GdomeElement * gdome_xml_doc_documentElement (GdomeDocument *self, GdomeException *exc); GdomeElement * gdome_xml_doc_createElement (GdomeDocument *self, GdomeDOMString *tagName, GdomeException *exc); GdomeElement * gdome_xml_doc_createElementNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); GdomeDocumentFragment * gdome_xml_doc_createDocumentFragment (GdomeDocument *self, GdomeException *exc); GdomeText * gdome_xml_doc_createTextNode (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc); GdomeComment * gdome_xml_doc_createComment (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc); GdomeCDATASection * gdome_xml_doc_createCDATASection (GdomeDocument *self, GdomeDOMString *data, GdomeException *exc); GdomeProcessingInstruction * gdome_xml_doc_createProcessingInstruction (GdomeDocument *self, GdomeDOMString *target, GdomeDOMString *data, GdomeException *exc); GdomeAttr * gdome_xml_doc_createAttribute (GdomeDocument *self, GdomeDOMString *name, GdomeException *exc); GdomeAttr * gdome_xml_doc_createAttributeNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); GdomeEntityReference * gdome_xml_doc_createEntityReference (GdomeDocument *self, GdomeDOMString *name, GdomeException *exc); GdomeElement * gdome_xml_doc_getElementById (GdomeDocument *self, GdomeDOMString *elementId, GdomeException *exc); GdomeNodeList * gdome_xml_doc_getElementsByTagName (GdomeDocument *self, GdomeDOMString *tagname, GdomeException *exc); GdomeNodeList * gdome_xml_doc_getElementsByTagNameNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeNode * gdome_xml_doc_importNode (GdomeDocument *self, GdomeNode *importedNode, GdomeBoolean deep, GdomeException *exc); GdomeEvent * gdome_xml_doc_createEvent (GdomeDocument *self, GdomeDOMString *eventType, GdomeException *exc); extern const GdomeDocumentVtab gdome_xml_doc_vtab; #endif /* GDOME_DOC_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-documentt.h0000664000076400007640000000657407470410747016206 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-documentt.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ----------------------------------------------------------------------- */ /* --------------------------- DOCUMENT_TYPE --------------------------- */ /* ----------------------------------------------------------------------- */ #ifndef GDOME_DOCUMENT_TYPE_FILE #define GDOME_DOCUMENT_TYPE_FILE struct _GdomeDocumentTypeVtab { GdomeNodeVtab super; GdomeDOMString *(*name) (GdomeDocumentType *self, GdomeException *exc); GdomeNamedNodeMap *(*entities) (GdomeDocumentType *self, GdomeException *exc); GdomeNamedNodeMap *(*notations) (GdomeDocumentType *self, GdomeException *exc); GdomeDOMString *(*publicId) (GdomeDocumentType *self, GdomeException *exc); GdomeDOMString *(*systemId) (GdomeDocumentType *self, GdomeException *exc); GdomeDOMString *(*internalSubset) (GdomeDocumentType *self, GdomeException *exc); }; typedef struct _Gdome_xml_DocumentType Gdome_xml_DocumentType; struct _Gdome_xml_DocumentType { GdomeDocumentType super; const GdomeDocumentTypeVtab *vtab; int refcnt; xmlDtd *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; xmlHashTable *entities; xmlHashTable *notations; }; GdomeDocumentType * gdome_xml_dt_mkref (xmlDtd *n); void gdome_xml_dt_unref (GdomeNode *self, GdomeException *exc); gpointer gdome_xml_dt_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); GdomeDOMString * gdome_xml_dt_name (GdomeDocumentType *self, GdomeException *exc); GdomeNamedNodeMap * gdome_xml_dt_entities (GdomeDocumentType *self, GdomeException *exc); GdomeNamedNodeMap * gdome_xml_dt_notations (GdomeDocumentType *self, GdomeException *exc); GdomeDOMString * gdome_xml_dt_publicId (GdomeDocumentType *self, GdomeException *exc); GdomeDOMString * gdome_xml_dt_systemId (GdomeDocumentType *self, GdomeException *exc); GdomeDOMString * gdome_xml_dt_internalSubset (GdomeDocumentType *self, GdomeException *exc); extern const GdomeDocumentTypeVtab gdome_xml_dt_vtab; #endif /* GDOME_DOCUMENT_TYPE_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-documentf.h0000664000076400007640000000365207470410747016162 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-documentf.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* --------------------------------------------------------------------------- */ /* --------------------------- Document Fragment --------------------------- */ /* --------------------------------------------------------------------------- */ #ifndef GDOME_DOCUMENT_FRAGMENT_FILE #define GDOME_DOCUMENT_FRAGMENT_FILE struct _GdomeDocumentFragmentVtab { GdomeNodeVtab super; }; typedef struct _Gdome_xml_DocumentFragment Gdome_xml_DocumentFragment; struct _Gdome_xml_DocumentFragment { GdomeDocumentFragment super; const GdomeDocumentFragmentVtab *vtab; int refcnt; xmlNode *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; gpointer gdome_xml_df_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); extern const GdomeDocumentFragmentVtab gdome_xml_df_vtab; #endif /* GDOME_DOCUMENT_FRAGMENT_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-domimpl.h0000664000076400007640000002167607702626141015640 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-domimpl.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2000 Anders Carlsson * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ----------------------------------------------------------------- */ /* ---------------------- DOMImplementation ---------------------- */ /* ----------------------------------------------------------------- */ #ifndef GDOME_DOMIMPL_FILE #define GDOME_DOMIMPL_FILE struct _GdomeDOMImplementationVtab { void (*ref) (GdomeDOMImplementation *self, GdomeException *exc); void (*unref) (GdomeDOMImplementation *self, GdomeException *exc); gpointer (*query_interface) (GdomeDOMImplementation *self, const char *interface, GdomeException *exc); GdomeBoolean (*hasFeature) (GdomeDOMImplementation *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDocumentType *(*createDocumentType) (GdomeDOMImplementation *self, GdomeDOMString *qualifiedName, GdomeDOMString *publicId, GdomeDOMString *systemId, GdomeException *exc); GdomeDocument *(*createDocument) (GdomeDOMImplementation *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeDocumentType *doctype, GdomeException *exc); void (*freeDoc) (GdomeDOMImplementation *self, GdomeDocument *doc, GdomeException *exc); GdomeDocument *(*createDocFromURI) (GdomeDOMImplementation *self, const char *uri, unsigned int mode, GdomeException *exc); GdomeDocument *(*createDocFromMemory) (GdomeDOMImplementation *self, char *buffer, unsigned int mode, GdomeException *exc); GdomeDocument *(*createDocFromURIWithEntitiesTable) (GdomeDOMImplementation *self, const char *uri, const GdomeEntitiesTableEntry entityTable[], unsigned int mode, GdomeException *exc); GdomeDocument *(*createDocFromMemoryWithEntitiesTable) (GdomeDOMImplementation *self, char *buffer, const GdomeEntitiesTableEntry entityTable[], unsigned int mode, GdomeException *exc); GdomeBoolean (*saveDocToFile) (GdomeDOMImplementation *self, GdomeDocument *doc, const char *filename, GdomeSavingCode mode, GdomeException *exc); GdomeBoolean (*saveDocToMemory) (GdomeDOMImplementation *self, GdomeDocument *doc, char **mem, GdomeSavingCode mode, GdomeException *exc); GdomeBoolean (*saveDocToFileEnc) (GdomeDOMImplementation *self, GdomeDocument *doc, const char *filename, const char *encoding, GdomeSavingCode mode, GdomeException *exc); GdomeBoolean (*saveDocToMemoryEnc) (GdomeDOMImplementation *self, GdomeDocument *doc, char **mem, const char *encoding, GdomeSavingCode mode, GdomeException *exc); void (*enableEvent) (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc); void (*disableEvent) (GdomeDOMImplementation *self, GdomeDocument* doc, const char *name, GdomeException *exc); GdomeBoolean (*eventIsEnabled) (GdomeDOMImplementation *self, GdomeDocument* doc, const char *name, GdomeException *exc); }; typedef struct _Gdome_xml_DOMImplementation Gdome_xml_DOMImplementation; struct _Gdome_xml_DOMImplementation { GdomeDOMImplementation super; const GdomeDOMImplementationVtab *vtab; int refcnt; }; GdomeDOMImplementation * gdome_xml_di_mkref (void); GdomeBoolean gdome_xml_di_hasFeature (GdomeDOMImplementation *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDocumentType *gdome_xml_di_createDocumentType (GdomeDOMImplementation *self, GdomeDOMString *qualifiedName, GdomeDOMString *publicId, GdomeDOMString *systemId, GdomeException *exc); GdomeDocument *gdome_xml_di_createDocument (GdomeDOMImplementation *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeDocumentType *doctype, GdomeException *exc); void gdome_xml_di_ref (GdomeDOMImplementation *self, GdomeException *exc); void gdome_xml_di_unref (GdomeDOMImplementation *self, GdomeException *exc); gpointer gdome_xml_di_query_interface (GdomeDOMImplementation *self, const char *interface, GdomeException *exc); void gdome_xml_di_freeDoc (GdomeDOMImplementation *self, GdomeDocument *doc, GdomeException *exc); GdomeDocument * gdome_xml_di_createDocFromURI (GdomeDOMImplementation *self, const char *uri, unsigned int mode, GdomeException *exc); GdomeDocument * gdome_xml_di_createDocFromMemory (GdomeDOMImplementation *self, char *buffer, unsigned int mode, GdomeException *exc); GdomeDocument * gdome_xml_di_createDocFromURIWithEntitiesTable (GdomeDOMImplementation *self, const char *uri, const GdomeEntitiesTableEntry entityTable[], unsigned int mode, GdomeException *exc); GdomeDocument * gdome_xml_di_createDocFromMemoryWithEntitiesTable (GdomeDOMImplementation *self, char *buffer, const GdomeEntitiesTableEntry entityTable[], unsigned int mode, GdomeException *exc); GdomeBoolean gdome_xml_di_saveDocToFile (GdomeDOMImplementation *self, GdomeDocument *doc, const char *filename, GdomeSavingCode mode, GdomeException *exc); GdomeBoolean gdome_xml_di_saveDocToFileEnc (GdomeDOMImplementation *self, GdomeDocument *doc, const char *filename, const char *encoding, GdomeSavingCode mode, GdomeException *exc); GdomeBoolean gdome_xml_di_saveDocToMemory (GdomeDOMImplementation *self, GdomeDocument *doc, char **mem, GdomeSavingCode mode, GdomeException *exc); GdomeBoolean gdome_xml_di_saveDocToMemoryEnc (GdomeDOMImplementation *self, GdomeDocument *doc, char **mem, const char *encoding, GdomeSavingCode mode, GdomeException *exc); void gdome_xml_di_enableEvent (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc); void gdome_xml_di_disableEvent (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc); GdomeBoolean gdome_xml_di_eventIsEnabled (GdomeDOMImplementation *self, GdomeDocument *doc, const char *name, GdomeException *exc); extern const GdomeDOMImplementationVtab gdome_xml_di_vtab; #endif /* GDOME_DOMIMPL_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-nnodem.h0000664000076400007640000001244407702626142015451 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-nnm.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2000 Anders Carlsson * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_XML_NNODEM_H #define GDOME_XML_NNODEM_H struct _GdomeNamedNodeMapVtab { void (*ref) (GdomeNamedNodeMap *self, GdomeException *exc); void (*unref) (GdomeNamedNodeMap *self, GdomeException *exc); gpointer (*query_interface) (GdomeNamedNodeMap *self, const char *interface, GdomeException *exc); GdomeNode *(*getNamedItem) (GdomeNamedNodeMap *self, GdomeDOMString *name, GdomeException *exc); GdomeNode *(*setNamedItem) (GdomeNamedNodeMap *self, GdomeNode *arg, GdomeException *exc); GdomeNode *(*removeNamedItem) (GdomeNamedNodeMap *self, GdomeDOMString *name, GdomeException *exc); GdomeNode *(*item) (GdomeNamedNodeMap *self, gulong index, GdomeException *exc); gulong (*length) (GdomeNamedNodeMap *self, GdomeException *exc); GdomeNode *(*getNamedItemNS) (GdomeNamedNodeMap *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeNode *(*setNamedItemNS) (GdomeNamedNodeMap *self, GdomeNode *arg, GdomeException *exc); GdomeNode *(*removeNamedItemNS) (GdomeNamedNodeMap *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); }; typedef struct _Gdome_xml_NamedNodeMap Gdome_xml_NamedNodeMap; struct _Gdome_xml_NamedNodeMap { GdomeNamedNodeMap super; const GdomeNamedNodeMapVtab *vtab; int refcnt; union { xmlHashTable *ht; xmlNode *lst; } data; xmlNs *ns; GdomeDocument *doc; GdomeElement *elem; GdomeAccessType accessType; GdomeNodeType type; }; extern const GdomeNamedNodeMapVtab gdome_xml_nnm_vtab; GdomeNamedNodeMap *gdome_xml_nnm_mkref (GdomeDocument *doc, GdomeElement *elem, void *data, void *data2, GdomeAccessType accessType, GdomeNodeType type); void gdome_xml_nnm_ref (GdomeNamedNodeMap *self, GdomeException *exc); void gdome_xml_nnm_unref (GdomeNamedNodeMap *self, GdomeException *exc); gpointer gdome_xml_nnm_query_interface (GdomeNamedNodeMap *self, const char *interface, GdomeException *exc); gulong gdome_xml_nnm_length (GdomeNamedNodeMap *self, GdomeException *exc); GdomeNode * gdome_xml_nnm_getNamedItem (GdomeNamedNodeMap *self, GdomeDOMString *name, GdomeException *exc); GdomeNode * gdome_xml_nnm_getNamedItemNS (GdomeNamedNodeMap *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeNode * gdome_xml_nnm_item (GdomeNamedNodeMap *self, gulong index, GdomeException *exc); GdomeNode * gdome_xml_nnm_removeNamedItem (GdomeNamedNodeMap *self, GdomeDOMString *name, GdomeException *exc); GdomeNode * gdome_xml_nnm_removeNamedItemNS (GdomeNamedNodeMap *self, GdomeDOMString *namespaceURI, GdomeDOMString *localName, GdomeException *exc); GdomeNode * gdome_xml_nnm_setNamedItem (GdomeNamedNodeMap *self, GdomeNode *arg, GdomeException *exc); GdomeNode * gdome_xml_nnm_setNamedItemNS (GdomeNamedNodeMap *self, GdomeNode *arg, GdomeException *exc); GdomeBoolean gdome_xml_nnm_eventEnabledByCode (GdomeNamedNodeMap *self, guint32 code); #endif /* GDOME_XML_NNODEM_H */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-nodel.h0000664000076400007640000000526207470410747015276 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-nodel.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_FILE_NODEL #define GDOME_FILE_NODEL struct _GdomeNodeListVtab { void (*ref) (GdomeNodeList *self, GdomeException *exc); void (*unref) (GdomeNodeList *self, GdomeException *exc); gpointer (*query_interface) (GdomeNodeList *self, const char *interface, GdomeException *exc); GdomeNode *(*item) (GdomeNodeList *self, gulong index, GdomeException *exc); gulong (*length) (GdomeNodeList *self, GdomeException *exc); }; typedef struct _Gdome_xml_NodeList Gdome_xml_NodeList; struct _Gdome_xml_NodeList { GdomeNodeList super; const GdomeNodeListVtab *vtab; int refcnt; GdomeNode *root; GdomeDOMString *tagName; GdomeDOMString *tagURI; GdomeAccessType accessType; }; GdomeNodeList * gdome_xml_nl_mkref (GdomeNode *root, GdomeDOMString *tagName, GdomeDOMString *tagURI, GdomeAccessType accessType); void gdome_xml_nl_ref (GdomeNodeList *self, GdomeException *exc); void gdome_xml_nl_unref (GdomeNodeList *self, GdomeException *exc); gpointer gdome_xml_nl_query_interface (GdomeNodeList *self, const char *interface, GdomeException *exc); GdomeNode * gdome_xml_nl_item (GdomeNodeList *self, gulong index, GdomeException *exc); gulong gdome_xml_nl_length (GdomeNodeList *self, GdomeException *exc); extern const GdomeNodeListVtab gdome_xml_nl_vtab; #endif /* GDOME_FILE_NODEL */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-node.h0000664000076400007640000002603707705723246015127 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-node.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* -------------------------------------------------------------- */ /* --------------------------- Node --------------------------- */ /* -------------------------------------------------------------- */ #ifndef GDOME_NODE_FILE #define GDOME_NODE_FILE struct _GdomeNodeVtab { void (*ref) (GdomeNode *self, GdomeException *exc); void (*unref) (GdomeNode *self, GdomeException *exc); gpointer (*query_interface) (GdomeNode *self, const char *interface, GdomeException *exc); GdomeDOMString * (*nodeName) (GdomeNode *self, GdomeException *exc); GdomeDOMString * (*nodeValue) (GdomeNode *self, GdomeException *exc); void (*set_nodeValue) (GdomeNode *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short (*nodeType) (GdomeNode *self, GdomeException *exc); GdomeNode * (*parentNode) (GdomeNode *self, GdomeException *exc); GdomeNodeList * (*childNodes) (GdomeNode *self, GdomeException *exc); GdomeNode * (*firstChild) (GdomeNode *self, GdomeException *exc); GdomeNode * (*lastChild) (GdomeNode *self, GdomeException *exc); GdomeNode * (*previousSibling) (GdomeNode *self, GdomeException *exc); GdomeNode * (*nextSibling) (GdomeNode *self, GdomeException *exc); GdomeNamedNodeMap * (*attributes) (GdomeNode *self, GdomeException *exc); GdomeDocument * (*ownerDocument) (GdomeNode *self, GdomeException *exc); GdomeNode * (*insertBefore) (GdomeNode *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode * (*replaceChild) (GdomeNode *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode * (*removeChild) (GdomeNode *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode * (*appendChild) (GdomeNode *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean (*hasChildNodes) (GdomeNode *self, GdomeException *exc); GdomeNode * (*cloneNode) (GdomeNode *self, GdomeBoolean deep, GdomeException *exc); void (*normalize) (GdomeNode *self, GdomeException *exc); GdomeBoolean (*isSupported) (GdomeNode *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString * (*namespaceURI) (GdomeNode *self, GdomeException *exc); GdomeDOMString * (*prefix) (GdomeNode *self, GdomeException *exc); void (*set_prefix) (GdomeNode *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString * (*localName) (GdomeNode *self, GdomeException *exc); GdomeBoolean (*hasAttributes) (GdomeNode *self, GdomeException *exc); void (*addEventListener) (GdomeNode *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void (*removeEventListener) (GdomeNode *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean (*dispatchEvent) (GdomeNode *self, GdomeEvent *evt, GdomeException *exc); void (*subTreeDispatchEvent) (GdomeNode *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean (*canAppend) (GdomeNode *self, GdomeNode *newChild, GdomeException *exc); }; /* structure used for the Node events */ typedef struct _Gdome_xml_ListenerList Gdome_xml_ListenerList; struct _Gdome_xml_ListenerList { Gdome_xml_ListenerList *next; guint32 type; GdomeEventListener *listener; GdomeBoolean useCapture; }; typedef struct _Gdome_xml_Node Gdome_xml_Node; struct _Gdome_xml_Node { GdomeNode super; const GdomeNodeVtab *vtab; int refcnt; xmlNode *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; xmlNode * gdome_xml_n_get_xmlNode (GdomeNode *node); GdomeNode * gdome_xml_n_mkref (xmlNode *n); void gdome_xml_n_ref (GdomeNode *self, GdomeException *exc); void gdome_xml_n_unref (GdomeNode *self, GdomeException *exc); gpointer gdome_xml_n_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); GdomeDOMString * gdome_xml_n_nodeName (GdomeNode *self, GdomeException *exc); GdomeDOMString * gdome_xml_n_nodeValue (GdomeNode *self, GdomeException *exc); void gdome_xml_n_set_nodeValue (GdomeNode *self, GdomeDOMString *nodeValue, GdomeException *exc); unsigned short gdome_xml_n_nodeType (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_xml_n_parentNode (GdomeNode *self, GdomeException *exc); GdomeNodeList * gdome_xml_n_childNodes (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_xml_n_firstChild (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_xml_n_lastChild (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_xml_n_previousSibling (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_xml_n_nextSibling (GdomeNode *self, GdomeException *exc); GdomeNamedNodeMap * gdome_xml_n_attributes (GdomeNode *self, GdomeException *exc); GdomeDocument * gdome_xml_n_ownerDocument (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_xml_n_insertBefore (GdomeNode *self, GdomeNode *newChild, GdomeNode *refChild, GdomeException *exc); GdomeNode * gdome_xml_n_replaceChild (GdomeNode *self, GdomeNode *newChild, GdomeNode *oldChild, GdomeException *exc); GdomeNode * gdome_xml_n_removeChild (GdomeNode *self, GdomeNode *oldChild, GdomeException *exc); GdomeNode * gdome_xml_n_appendChild (GdomeNode *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_xml_n_hasChildNodes (GdomeNode *self, GdomeException *exc); GdomeNode * gdome_xml_n_cloneNode (GdomeNode *self, GdomeBoolean deep, GdomeException *exc); void gdome_xml_n_normalize (GdomeNode *self, GdomeException *exc); GdomeBoolean gdome_xml_n_isSupported (GdomeNode *self, GdomeDOMString *feature, GdomeDOMString *version, GdomeException *exc); GdomeDOMString * gdome_xml_n_namespaceURI (GdomeNode *self, GdomeException *exc); GdomeDOMString * gdome_xml_n_prefix (GdomeNode *self, GdomeException *exc); void gdome_xml_n_set_prefix (GdomeNode *self, GdomeDOMString *prefix, GdomeException *exc); GdomeDOMString * gdome_xml_n_localName (GdomeNode *self, GdomeException *exc); GdomeBoolean gdome_xml_n_hasAttributes (GdomeNode *self, GdomeException *exc); void gdome_xml_n_addEventListener (GdomeNode *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); void gdome_xml_n_removeEventListener (GdomeNode *self, GdomeDOMString *type, GdomeEventListener *listener, GdomeBoolean useCapture, GdomeException *exc); GdomeBoolean gdome_xml_n_dispatchEvent (GdomeNode *self, GdomeEvent *evt, GdomeException *exc); GdomeNode * gdome_xml_n_appendChild (GdomeNode *self, GdomeNode *newChild, GdomeException *exc); void gdome_xml_n_subTreeDispatchEvent (GdomeNode *self, GdomeEvent *evt, GdomeException *exc); GdomeBoolean gdome_xml_n_canAppend (GdomeNode *self, GdomeNode *newChild, GdomeException *exc); GdomeBoolean gdome_xml_n_eventEnabledByCode (GdomeNode *self, guint32 code); extern const GdomeNodeVtab gdome_xml_n_vtab; #endif /* GDOME_NODE_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-pi.h0000664000076400007640000000532007470410747014600 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-pi.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ------------------------------------------------------------------------------- */ /* --------------------------- ProcessingInstruction --------------------------- */ /* ------------------------------------------------------------------------------- */ #ifndef GDOME_PI_FILE #define GDOME_PI_FILE struct _GdomeProcessingInstructionVtab { GdomeNodeVtab super; GdomeDOMString *(*target) (GdomeProcessingInstruction *self, GdomeException *exc); GdomeDOMString *(*data) (GdomeProcessingInstruction *self, GdomeException *exc); void (*set_data) (GdomeProcessingInstruction *self, GdomeDOMString *data, GdomeException *exc); }; typedef struct _Gdome_xml_ProcessingInstruction Gdome_xml_ProcessingInstruction; struct _Gdome_xml_ProcessingInstruction { GdomeProcessingInstruction super; const GdomeProcessingInstructionVtab *vtab; int refcnt; xmlNode *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; extern const GdomeProcessingInstructionVtab gdome_xml_pi_vtab; gpointer gdome_xml_pi_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); GdomeDOMString * gdome_xml_pi_target (GdomeProcessingInstruction *self, GdomeException *exc); GdomeDOMString * gdome_xml_pi_data (GdomeProcessingInstruction *self, GdomeException *exc); void gdome_xml_pi_set_data (GdomeProcessingInstruction *self, GdomeDOMString *data, GdomeException *exc); #endif /* GDOME_PI_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-notation.h0000664000076400007640000000441707470410747016031 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-notation.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ------------------------------------------------------------------ */ /* --------------------------- Notation --------------------------- */ /* ------------------------------------------------------------------ */ #ifndef GDOME_NOTATION_FILE #define GDOME_NOTATION_FILE struct _GdomeNotationVtab { GdomeNodeVtab super; GdomeDOMString *(*publicId) (GdomeNotation *self, GdomeException *exc); GdomeDOMString *(*systemId) (GdomeNotation *self, GdomeException *exc); }; typedef struct _Gdome_xml_Notation Gdome_xml_Notation; struct _Gdome_xml_Notation { GdomeNotation super; const GdomeNotationVtab *vtab; int refcnt; gdome_xmlNotation *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; extern const GdomeNotationVtab gdome_xml_not_vtab; gpointer gdome_xml_not_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); GdomeDOMString * gdome_xml_not_publicId (GdomeNotation *self, GdomeException *exc); GdomeDOMString * gdome_xml_not_systemId (GdomeNotation *self, GdomeException *exc); #endif /* GDOME_NOTATION_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-entity.h0000664000076400007640000000467607470410747015521 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-entity.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ---------------------------------------------------------------- */ /* --------------------------- Entity --------------------------- */ /* ---------------------------------------------------------------- */ #ifndef GDOME_ENTITY_FILE #define GDOME_ENTITY_FILE struct _GdomeEntityVtab { GdomeNodeVtab super; GdomeDOMString *(*publicId) (GdomeEntity *self, GdomeException *exc); GdomeDOMString *(*systemId) (GdomeEntity *self, GdomeException *exc); GdomeDOMString *(*notationName) (GdomeEntity *self, GdomeException *exc); }; typedef struct _Gdome_xml_Entity Gdome_xml_Entity; struct _Gdome_xml_Entity { GdomeEntity super; const GdomeEntityVtab *vtab; int refcnt; xmlEntity *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; extern const GdomeEntityVtab gdome_xml_ent_vtab; gpointer gdome_xml_ent_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); GdomeDOMString * gdome_xml_ent_publicId (GdomeEntity *self, GdomeException *exc); GdomeDOMString * gdome_xml_ent_systemId (GdomeEntity *self, GdomeException *exc); GdomeDOMString * gdome_xml_ent_notationName (GdomeEntity *self, GdomeException *exc); #endif /* GDOME_ENTITY_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-xmlutil.h0000664000076400007640000001616007737315575015703 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-xmlutil.h * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_XML_XMLUTIL_H #define GDOME_XML_XMLUTIL_H #define INLINE0 #ifdef INLINE #define gdome_xmlGetPrev(node) ((node)->prev) #define gdome_xmlSetPrev(node,p) ((node)->prev = (p)) #define gdome_xmlGetNext(node) ((node)->next) #define gdome_xmlSetNext(node,p) ((node)->next = (p)) #define gdome_xmlGetFirstChild(node) ((node)->children) #define gdome_xmlSetFirstChild(node,p) ((node)->children = (p)) #define gdome_xmlGetLastChild(node) ((node)->last) #define gdome_xmlSetLastChild(node,p) ((node)->last = (p)) #define gdome_xmlGetAttrList(elem) ((elem)->properties) #define gdome_xmlSetAttrList(elem,p) ((elem)->properties = (p)) #define gdome_xmlGetNsDeclList(elem) ((elem)->nsDef) #define gdome_xmlGetOwner(node) ((node)->doc) #define gdome_xmlSetOwner(node,p) ((node)->doc = (p)) #define gdome_xmlGetParent(node) ((node)->parent) #define gdome_xmlSetParent(node,p) ((node)->parent = (p)) #define gdome_xmlGetNs(node) ((node)->ns) #define gdome_xmlSetNs(node,p) ((node)->ns = (p)) #define gdome_xmlGetType(node) ((node)->type) #define gdome_xmlGetName(node) ((node)->name) #define gdome_xmlGetContent(node) ((node)->content) #else xmlNode * gdome_xmlGetPrev (xmlNode *node); void gdome_xmlSetPrev (xmlNode *node, xmlNode *prev); xmlNode * gdome_xmlGetNext (xmlNode *node); void gdome_xmlSetNext (xmlNode *node, xmlNode *next); xmlNode * gdome_xmlGetFirstChild (xmlNode *node); void gdome_xmlSetFirstChild (xmlNode *node, xmlNode *first); xmlNode * gdome_xmlGetLastChild (xmlNode *node); void gdome_xmlSetLastChild (xmlNode *node, xmlNode *last); xmlAttr * gdome_xmlGetAttrList (xmlNode *elem); xmlNs * gdome_xmlGetNsDeclList (xmlNode *elem); void gdome_xmlSetAttrList (xmlNode *elem, xmlAttr *attr); xmlDoc * gdome_xmlGetOwner (xmlNode *node); void gdome_xmlSetOwner (xmlNode *node, xmlDoc *owner); xmlNode * gdome_xmlGetParent (xmlNode *node); void gdome_xmlSetParent (xmlNode *node, xmlNode *parent); xmlNs * gdome_xmlGetNs (xmlNode *node); void gdome_xmlSetNs (xmlNode *node, xmlNs *ns); xmlElementType gdome_xmlGetType (xmlNode *node); const xmlChar * gdome_xmlGetName (xmlNode *node); xmlChar * gdome_xmlGetContent (xmlNode *node); #endif /* INLINE */ void gdome_xmlSetNsDeclList (xmlNode *elem, xmlChar *prefix, xmlChar *href); xmlDoc * gdome_xmlGetOwnerOrSelf (xmlNode *node); const xmlChar * gdome_xmlGetNsPrefix (xmlNode *node); const xmlChar * gdome_xmlGetNsURI (xmlNode *node); xmlAttr * gdome_xmlGetAttr (xmlNode *elem, const xmlChar* name); xmlAttr * gdome_xmlGetNsAttr (xmlNode *elem, const xmlChar* namespaceURI, const xmlChar* localName); void gdome_xmlSetAttrValue (xmlAttr *attr, xmlChar *value); xmlNode * gdome_xmlAppendChild (xmlNode *parent, xmlNode *child); xmlNode * gdome_xmlInsertBeforeChild (xmlNode *parent, xmlNode* newchild, xmlNode *refchild); xmlNode * gdome_xmlUnlinkChild (xmlNode *parent, xmlNode *child); xmlAttr * gdome_xmlUnlinkAttr (xmlNode *elem, const xmlChar* name); xmlAttr * gdome_xmlUnlinkNsAttr (xmlNode *elem, const xmlChar* namespaceURI, const xmlChar* localName); xmlNs * gdome_xmlUnlinkNsDecl (xmlNode *elem, const xmlChar* localName); int gdome_xmlLinkAttr (xmlNode *elem, xmlAttr *attr); int gdome_xmlLinkNsDecl (xmlNode *elem, xmlChar *prefix, xmlChar *href); xmlNode * gdome_xmlGetChildrenItem (xmlNode *parent, gulong index); xmlNode * gdome_xmlNamedPreorderTraversal (xmlNode *root, xmlChar *tagURI, xmlChar *tagName, gulong *cur, gulong index); gulong gdome_xmlGetChildrensLength (xmlNode *parent); void gdome_xmlNamedCntTreeElements (xmlNode *root, xmlChar *tagURI, xmlChar *tagName, gulong *cur); xmlNs * gdome_xmlGetNsDecl (xmlNode *elem, xmlChar *localName); xmlAttrPtr gdome_xmlNewNsDecl (xmlNodePtr node, const xmlChar *name, const xmlChar *value); GdomeBoolean gdome_xmlIsNsDecl (xmlAttr *a); xmlNs * gdome_xmlGetNsDeclByAttr (xmlAttr *a); void gdome_xmlSetOldNs (xmlDoc *doc, xmlNs *ns); xmlNs * gdome_xmlNewNs (xmlDoc *doc, const xmlChar *href, const xmlChar *prefix); #endif /* GDOME_XML_XMLUTIL_H */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-cdatas.h0000664000076400007640000000304007470410747015424 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-cdatas.h * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_CDATA_SECTION_FILE #define GDOME_CDATA_SECTION_FILE struct _GdomeCDATASectionVtab { GdomeTextVtab super; }; typedef struct _Gdome_xml_CDATASection Gdome_xml_CDATASection; struct _Gdome_xml_CDATASection { GdomeCDATASection super; const GdomeCDATASectionVtab *vtab; int refcnt; xmlNode *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; gpointer gdome_xml_cds_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); extern const GdomeCDATASectionVtab gdome_xml_cds_vtab; #endif /* GDOME_CDATA_SECTION_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-entityref.h0000664000076400007640000000305607470410747016205 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-entityref.h * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_ENTITY_REF_FILE #define GDOME_ENTITY_REF_FILE struct _GdomeEntityReferenceVtab { GdomeNodeVtab super; }; typedef struct _Gdome_xml_EntityReference Gdome_xml_EntityReference; struct _Gdome_xml_EntityReference { GdomeEntityReference super; const GdomeEntityReferenceVtab *vtab; int refcnt; xmlNode *n; GdomeAccessType accessType; Gdome_xml_ListenerList *ll; }; gpointer gdome_xml_er_query_interface (GdomeNode *self, const char *interface, GdomeException *exc); extern const GdomeEntityReferenceVtab gdome_xml_er_vtab; #endif /* GDOME_ENTITY_REF_FILE */ gdome2-0.8.1/libgdome/gdomecore/gdome-xml-xpns.h0000664000076400007640000000303007470410747015154 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-xpns.h * * CopyRight (C) 2002 T.J. Mather * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_XPNS_FILE #define GDOME_XPNS_FILE struct _GdomeXPathNamespaceVtab { GdomeNodeVtab super; GdomeElement *(*ownerElement) (GdomeXPathNamespace *self, GdomeException *exc); }; typedef struct _Gdome_xml_XPathNamespace Gdome_xml_XPathNamespace; struct _Gdome_xml_XPathNamespace { GdomeXPathNamespace super; const GdomeXPathNamespaceVtab *vtab; int refcnt; xmlNode *n; GdomeAccessType accessType; }; GdomeXPathNamespace * gdome_xml_xpns_mkref (xmlNs *n); GdomeElement * gdome_xml_xpns_ownerElement (GdomeXPathNamespace *self, GdomeException *exc); extern const GdomeXPathNamespaceVtab gdome_xml_xpns_vtab; #endif /* GDOME_XPNS_FILE */ gdome2-0.8.1/libgdome/events/0000777000076400007640000000000007740102241011535 5gdome2-0.8.1/libgdome/events/Makefile.in0000664000076400007640000002104607740102241013523 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EXEEXT = @EXEEXT@ GDOME_INCLUDEDIR = @GDOME_INCLUDEDIR@ GDOME_LIBDIR = @GDOME_LIBDIR@ GDOME_LIBS = @GDOME_LIBS@ GDOME_VERSION_INFO = @GDOME_VERSION_INFO@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MIN_VERSION = @GLIB_MIN_VERSION@ GLIB_MKENUMS = @GLIB_MKENUMS@ GLIB_REQUIRED = @GLIB_REQUIRED@ GOBJECT_QUERY = @GOBJECT_QUERY@ HTML_DIR = @HTML_DIR@ LDFLAGS = @LDFLAGS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_MIN_VERSION = @XML_MIN_VERSION@ NULL = INCLUDES = \ -I$(top_srcdir)/libgdome \ -I$(top_srcdir)/libgdome/gdomecore \ $(LIBXML_CFLAGS) \ $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) noinst_LTLIBRARIES = libgdomeevents.la libgdomeevents_la_SOURCES = \ gdome-evt-mevent.c \ gdome-evt-eventl.c \ gdome-evt-event.c \ gdome-evt-propagation.c \ $(NULL) EXTRA_DIST = \ gdome-evt-mevent.h \ gdome-evt-eventl.h \ gdome-evt-event.h \ gdome-evt-propagation.h \ gdome-evt-util.h \ $(NULL) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../../config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) -I../.. LIBS = @LIBS@ libgdomeevents_la_LDFLAGS = libgdomeevents_la_LIBADD = libgdomeevents_la_OBJECTS = gdome-evt-mevent.lo gdome-evt-eventl.lo \ gdome-evt-event.lo gdome-evt-propagation.lo 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 = $(libgdomeevents_la_SOURCES) OBJECTS = $(libgdomeevents_la_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps libgdome/events/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-noinstLTLIBRARIES: clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) distclean-noinstLTLIBRARIES: maintainer-clean-noinstLTLIBRARIES: .c.o: $(COMPILE) -c $< # FIXME: We should only use cygpath when building on Windows, # and only if it is available. .c.obj: $(COMPILE) -c `cygpath -w $<` .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core -rm -f *.$(OBJEXT) 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: libgdomeevents.la: $(libgdomeevents_la_OBJECTS) $(libgdomeevents_la_DEPENDENCIES) $(LINK) $(libgdomeevents_la_LDFLAGS) $(libgdomeevents_la_OBJECTS) $(libgdomeevents_la_LIBADD) $(LIBS) 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 = libgdome/events 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-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile $(LTLIBRARIES) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: 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-noinstLTLIBRARIES mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \ clean-tags clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-noinstLTLIBRARIES distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \ 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-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \ clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \ 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 # libgdomeincdir = $(includedir)/libgdome # 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: gdome2-0.8.1/libgdome/events/Makefile.am0000664000076400007640000000105207301500273013505 NULL = INCLUDES = \ -I$(top_srcdir)/libgdome \ -I$(top_srcdir)/libgdome/gdomecore \ $(LIBXML_CFLAGS) \ $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) noinst_LTLIBRARIES = libgdomeevents.la libgdomeevents_la_SOURCES = \ gdome-evt-mevent.c \ gdome-evt-eventl.c \ gdome-evt-event.c \ gdome-evt-propagation.c \ $(NULL) EXTRA_DIST = \ gdome-evt-mevent.h \ gdome-evt-eventl.h \ gdome-evt-event.h \ gdome-evt-propagation.h \ gdome-evt-util.h \ $(NULL) # libgdomeincdir = $(includedir)/libgdome gdome2-0.8.1/libgdome/events/gdome-evt-mevent.c0000664000076400007640000002533007705757471015033 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-mevent.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 "gdome.h" #include "gdome-events.h" #include "gdome-refdebug.h" #include "gdome-evt-util.h" #include "gdome-xml-node.h" #include "gdome-xml-str.h" #include "gdome-evt-event.h" #include "gdome-evt-eventl.h" #include "gdome-evt-mevent.h" const GdomeMutationEventVtab gdome_evt_mevnt_vtab = { { gdome_evt_evnt_ref, gdome_evt_mevnt_unref, gdome_evt_mevnt_query_interface, gdome_evt_evnt_bubbles, gdome_evt_evnt_cancelable, gdome_evt_evnt_currentTarget, gdome_evt_evnt_eventPhase, gdome_evt_evnt_target, gdome_evt_evnt_timeStamp, gdome_evt_evnt_type, gdome_evt_evnt_initEvent, gdome_evt_evnt_preventDefault, gdome_evt_evnt_stopPropagation, }, gdome_evt_mevnt_attrChange, gdome_evt_mevnt_attrName, gdome_evt_mevnt_newValue, gdome_evt_mevnt_prevValue, gdome_evt_mevnt_relatedNode, gdome_evt_mevnt_initMutationEvent }; /** * gdome_evt_mevnt_mkref: * * Returns: a new allocated #GdomeMutationEvent. */ GdomeMutationEvent * gdome_evt_mevnt_mkref (void) { Gdome_evt_MutationEvent *result = NULL; result = g_new (Gdome_evt_MutationEvent, 1); #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)result, GDOME_REFDBG_EVENT); #endif memset(result, 0, sizeof(Gdome_evt_MutationEvent)); result->vtab = &gdome_evt_mevnt_vtab; result->etype = GDOME_MUTATION_EVENT; result->refcnt = 1; result->super.user_data = NULL; return (GdomeMutationEvent *)result; } /** * gdome_evt_mevnt_unref: * @self: MutationEvent Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified MutationEvent. Free the * MutationEvent structure if the MutationEvent will have zero reference. */ void gdome_evt_mevnt_unref (GdomeEvent *self, GdomeException *exc) { Gdome_evt_MutationEvent *priv = (Gdome_evt_MutationEvent *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EVNT (priv)); g_return_if_fail (exc != NULL); if (--priv->refcnt == 0) { if (priv->attrName != NULL) gdome_xml_str_unref (priv->attrName); if (priv->newValue != NULL) gdome_xml_str_unref (priv->newValue); if (priv->prevValue != NULL) gdome_xml_str_unref (priv->prevValue); if (priv->relatedNode != NULL) gdome_xml_n_unref (priv->relatedNode, exc); #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_EVENT); #endif g_free (self); } } /** * gdome_evt_mevnt_query_interface: * @self: Event Object ref * @interface: name of the Interface needed. * @exc: Exception Object ref * * Returns: a reference to the object that implements the interface needed or * %NULL if this object doesn't implement the interface specified. */ void * gdome_evt_mevnt_query_interface (GdomeEvent *self, const char *interface, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EVNT (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Event") || !strcmp (interface, "MutationEvent")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_evt_mevnt_attrChange: * @self: MutationEvent Object ref * @exc: Exception Object ref * * Returns: the type of change which triggered the DOMAttrModified event. * The values can be %MODIFICATION, %ADDITION, or %REMOVAL. If an error * occur, %0 is returned. */ gushort gdome_evt_mevnt_attrChange (GdomeMutationEvent *self, GdomeException *exc) { Gdome_evt_MutationEvent *priv = (Gdome_evt_MutationEvent *)self; g_return_val_if_fail (self != NULL, 0); g_return_val_if_fail (exc != NULL, 0); return priv->attrChange; } /** * gdome_evt_mevnt_attrName: * @self: MutationEvent Object ref * @exc: Exception Object ref * * Returns: the name of the changed Attr node in a DOMAttrModified event. */ GdomeDOMString * gdome_evt_mevnt_attrName (GdomeMutationEvent *self, GdomeException *exc) { Gdome_evt_MutationEvent *priv = (Gdome_evt_MutationEvent *)self; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (priv->attrName != NULL) gdome_str_ref(priv->attrName); return priv->attrName; } /** * gdome_evt_mevnt_newValue: * @self: MutationEvent Object ref * @exc: Exception Object ref * * Returns: the new value of the Attr node in DOMAttrModified events, * and of the CharacterData node in DOMCharDataModified events. */ GdomeDOMString * gdome_evt_mevnt_newValue (GdomeMutationEvent *self, GdomeException *exc) { Gdome_evt_MutationEvent *priv = (Gdome_evt_MutationEvent *)self; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (priv->newValue != NULL) gdome_str_ref(priv->newValue); return priv->newValue; } /** * gdome_evt_mevnt_prevValue: * @self: MutationEvent Object ref * @exc: Exception Object ref * * Returns: the previous value of the Attr node in DOMAttrModified events, * and of the CharacterData node in DOMCharDataModified events. */ GdomeDOMString * gdome_evt_mevnt_prevValue (GdomeMutationEvent *self, GdomeException *exc) { Gdome_evt_MutationEvent *priv = (Gdome_evt_MutationEvent *)self; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (priv->prevValue != NULL) gdome_str_ref(priv->prevValue); return priv->prevValue; } /** * gdome_evt_mevnt_relatedNode: * @self: MutationEvent Object ref * @exc: Exception Object ref * * Returns: a secondary node related to a mutation event. For example, if a * mutation event is dispatched to a node indicating that its parent has * changed, the relatedNode is the changed parent. If an event is instead * dispatched to a subtree indicating a node was changed within it, the * relatedNode is the changed node. In the case of the DOMAttrModified event * it indicates the Attr node which was modified, added, or removed. */ GdomeNode * gdome_evt_mevnt_relatedNode (GdomeMutationEvent *self, GdomeException *exc) { Gdome_evt_MutationEvent *priv = (Gdome_evt_MutationEvent *)self; g_return_val_if_fail (self != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (priv->relatedNode != NULL) gdome_n_ref(priv->relatedNode, exc); return priv->relatedNode; } /** * gdome_evt_mevnt_initMutationEventByCode: * * see documentation for gdome_evt_mevnt_initMutationEvent */ void gdome_evt_mevnt_initMutationEventByCode (GdomeMutationEvent *self, guint32 typeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeNode *relatedNodeArg, GdomeDOMString *prevValueArg, GdomeDOMString *newValueArg, GdomeDOMString *attrNameArg, gushort attrChangeArg, GdomeException *exc) { Gdome_evt_MutationEvent *priv = (Gdome_evt_MutationEvent *)self; g_return_if_fail (self != NULL); g_return_if_fail (exc != NULL); gdome_evt_evnt_initEventByCode ((GdomeEvent *)self, typeArg, canBubbleArg, cancelableArg, exc); priv->attrChange = attrChangeArg; if (attrNameArg != NULL) { gdome_xml_str_ref (attrNameArg); priv->attrName = attrNameArg; } if (newValueArg != NULL) { gdome_xml_str_ref (newValueArg); priv->newValue = newValueArg; } if (prevValueArg != NULL) { gdome_xml_str_ref (prevValueArg); priv->prevValue = prevValueArg; } if (relatedNodeArg != NULL) { gdome_xml_n_ref (relatedNodeArg, exc); priv->relatedNode = relatedNodeArg; } } /** * gdome_evt_mevnt_initMutationEvent: * @self: MutationEvent Object ref * @typeArg: Specifies the event type. * @canBubbleArg: Specifies whether or not the event can bubble. * @cancelableArg: Specifies whether or not the event's default action * can be prevented. * @relatedNodeArg: Specifies the Event's related Node. This value may * be %NULL. * @prevValueArg: Specifies the Event's prevValue attribute. This value * may be %NULL. * @newValueArg: Specifies the Event's newValue attribute. This value * may be %NULL. * @attrNameArg: Specifies the Event's attrName attribute. This value * may be null. * @attrChangeArg: Specifies the Event's attrChange attribute * @exc: Exception Object ref * * The initMutationEvent method is used to initialize the value of a * #GdomeMutationEvent created through the DocumentEvent interface. This * method may only be called before the MutationEvent has been dispatched * via the dispatchEvent method, though it may be called multiple times * during that phase if necessary. If called multiple times, the final * invocation takes precedence. */ void gdome_evt_mevnt_initMutationEvent (GdomeMutationEvent *self, GdomeDOMString *typeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeNode *relatedNodeArg, GdomeDOMString *prevValueArg, GdomeDOMString *newValueArg, GdomeDOMString *attrNameArg, gushort attrChangeArg, GdomeException *exc) { g_return_if_fail (typeArg != NULL); gdome_evt_mevnt_initMutationEventByCode (self, gdome_evt_evnt_codeOfName (typeArg->str), canBubbleArg, cancelableArg, relatedNodeArg, prevValueArg, newValueArg, attrNameArg, attrChangeArg, exc); } gdome2-0.8.1/libgdome/events/gdome-evt-eventl.c0000664000076400007640000001447707625205236015030 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-eventl.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 "gdome.h" #include "gdome-events.h" #include "gdome-refdebug.h" #include "gdome-evt-util.h" #include "gdome-evt-eventl.h" #include "gdome-evt-event.h" const GdomeEventListenerVtab gdome_evt_evntl_vtab = { gdome_evt_evntl_ref, gdome_evt_evntl_unref, gdome_evt_evntl_query_interface, gdome_evt_evntl_handleEvent }; /** * gdome_evt_evntl_aux_mkref: * @callback: the callback function that is to be called when * gdome_evntl_handleEvent() is called. * @priv: private data * @priv_callback: the callback function to be called just before * the event listener is destroyed, so that the * client can do something sensible with the * priv field (like unreffing it) * * Returns: a new allocated #GdomeEventListener. */ GdomeEventListener * gdome_evt_evntl_aux_mkref (void (*callback) (GdomeEventListener *self, GdomeEvent *event, GdomeException *exc), gpointer priv, void (*priv_callback)(GdomeEventListener* self)) { Gdome_evt_EventListener *result = NULL; result = g_new (Gdome_evt_EventListener, 1); #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)result, GDOME_REFDBG_EVENTLISTENER); #endif result->refcnt = 1; result->vtab = (GdomeEventListenerVtab *) &gdome_evt_evntl_vtab; result->super.user_data = NULL; result->callback = callback; result->priv = priv; result->priv_callback = priv_callback; return (GdomeEventListener *)result; } /** * gdome_evt_evntl_mkref: * @callback: the callback function that is to be called when * gdome_evntl_handleEvent() is called. * @priv: private data * * Returns: a new allocated #GdomeEventListener. */ GdomeEventListener * gdome_evt_evntl_mkref (void (*callback) (GdomeEventListener *self, GdomeEvent *event, GdomeException *exc), gpointer priv) { return gdome_evt_evntl_aux_mkref(callback, priv, NULL); } /* an extension to the DOM spec. You can attach abitrary data to the listener and get it back through this function when the listener is called. This is used specifically by Gill. It is baaaad. I need to find another way to do this fast. */ /** * gdome_evt_evntl_get_priv: * @self: EventListener Object Ref * * DEPRECATED * Returns: the priv data field associated with this object */ gpointer gdome_evt_evntl_get_priv (GdomeEventListener *self) { Gdome_evt_EventListener *priv = (Gdome_evt_EventListener *) self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EVNTL (priv), NULL); return priv->priv; } /** * gdome_evt_evntl_ref: * @self: EventListener Object ref * @exc: Exception Object ref * * Increase the reference count of the specified EventListener. */ void gdome_evt_evntl_ref (GdomeEventListener *self, GdomeException *exc) { Gdome_evt_EventListener *priv = (Gdome_evt_EventListener *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EVNTL (priv)); g_return_if_fail (exc != NULL); priv->refcnt++; } /** * gdome_evt_evntl_unref: * @self: EventListener Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified EventListener. Free the * EventListener structure if the EventListener will have zero reference. */ void gdome_evt_evntl_unref (GdomeEventListener *self, GdomeException *exc) { Gdome_evt_EventListener *priv = (Gdome_evt_EventListener *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EVNTL (priv)); g_return_if_fail (exc != NULL); if (--priv->refcnt == 0) { if (priv->priv_callback != NULL) priv->priv_callback(self); #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_EVENTLISTENER); #endif g_free (self); } } /** * gdome_evt_evntl_query_interface: * @self: EventListener Object ref * @interface: name of the Interface needed. * @exc: Exception Object ref * * Returns: a reference to the object that implements the interface needed or * %NULL if this object doesn't implement the interface specified. */ gpointer gdome_evt_evntl_query_interface (GdomeEventListener *self, const char *interface, GdomeException *exc) { Gdome_evt_EventListener *priv = (Gdome_evt_EventListener *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EVNTL (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "EventListener")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_evt_evntl_handleEvent: * @self: EventListener Object ref * @evt: the Event Object ref that contains contextual information about the * event. * @exc: Exception Object ref * * This method is called whenever an event occurs of the type for which the * EventListener interface was registered. */ void gdome_evt_evntl_handleEvent (GdomeEventListener *self, GdomeEvent *evt, GdomeException *exc) { Gdome_evt_EventListener *priv = (Gdome_evt_EventListener *) self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EVNTL (priv)); g_return_if_fail (evt != NULL); g_return_if_fail (GDOME_XML_IS_EVNT (evt)); g_return_if_fail (exc != NULL); priv->callback (self, evt, exc); } gdome2-0.8.1/libgdome/events/gdome-evt-event.c0000664000076400007640000003256007705757471014661 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xml-event.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 "gdome.h" #include "gdome-events.h" #include "gdome-refdebug.h" #include "gdome-evt-util.h" #include "gdome-xml-str.h" #include "gdome-xml-node.h" #include "gdome-evt-event.h" static struct { const char* name; guint32 code; } eventNameTypeMap[] = { { "DOMSubtreeModified", DOM_SUBTREE_MODIFIED_EVENT_TYPE }, { "DOMNodeInserted", DOM_NODE_INSERTED_EVENT_TYPE }, { "DOMNodeInsertedIntoDocument", DOM_NODE_INSERTED_INTO_DOCUMENT_EVENT_TYPE }, { "DOMNodeRemoved", DOM_NODE_REMOVED_EVENT_TYPE }, { "DOMNodeRemovedFromDocument", DOM_NODE_REMOVED_FROM_DOCUMENT_EVENT_TYPE }, { "DOMAttrModified", DOM_ATTR_MODIFIED_EVENT_TYPE }, { "DOMCharacterDataModified", DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE }, /* some wildcards */ { "", 0 }, { "*", DOM_ALL_EVENT_TYPES }, { NULL, 0 } }; const GdomeEventVtab gdome_evt_evnt_vtab = { gdome_evt_evnt_ref, gdome_evt_evnt_unref, gdome_evt_evnt_query_interface, gdome_evt_evnt_bubbles, gdome_evt_evnt_cancelable, gdome_evt_evnt_currentTarget, gdome_evt_evnt_eventPhase, gdome_evt_evnt_target, gdome_evt_evnt_timeStamp, gdome_evt_evnt_type, gdome_evt_evnt_initEvent, gdome_evt_evnt_preventDefault, gdome_evt_evnt_stopPropagation, }; /** * gdome_evt_evnt_mkref: * * Returns: a new allocated #GdomeEvent. */ GdomeEvent * gdome_evt_evnt_mkref (void) { Gdome_evt_Event *result = NULL; result = g_new (Gdome_evt_Event, 1); #ifdef DEBUG_REFCNT gdome_refdbg_addRef ((void *)result, GDOME_REFDBG_EVENT); #endif memset(result, 0, sizeof(Gdome_evt_Event)); result->vtab = &gdome_evt_evnt_vtab; result->etype = GDOME_BASE_EVENT; result->refcnt = 1; result->super.user_data = NULL; return (GdomeEvent *)result; } /** * gdome_evt_evnt_ref: * @self: Event Object ref * @exc: Exception Object ref * * Increase the reference count of the specified Event. */ void gdome_evt_evnt_ref (GdomeEvent *self, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EVNT (priv)); g_return_if_fail (exc != NULL); priv->refcnt++; } /** * gdome_evt_evnt_unref: * @self: Event Object ref * @exc: Exception Object ref * * Decrease the reference count of the specified Event. Free the Event * structure if the Event will have zero reference. */ void gdome_evt_evnt_unref (GdomeEvent *self, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EVNT (priv)); g_return_if_fail (exc != NULL); if (--priv->refcnt == 0) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_EVENT); #endif g_free (self); } } /** * gdome_evt_evnt_query_interface: * @self: Event Object ref * @interface: name of the Interface needed. * @exc: Exception Object ref * * Returns: a reference to the object that implements the interface needed or * %NULL if this object doesn't implement the interface specified. */ gpointer gdome_evt_evnt_query_interface (GdomeEvent *self, const char *interface, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EVNT (priv), NULL); g_return_val_if_fail (interface != NULL, NULL); g_return_val_if_fail (exc != NULL, NULL); if (!strcmp (interface, "Event")) { priv->refcnt++; return self; } else return NULL; } /** * gdome_evt_evnt_bubbles: * @self: Event Object ref * @exc: Exception Object ref * * Returns: If the event can bubble the value is %TRUE, else the value is * %FALSE. */ GdomeBoolean gdome_evt_evnt_bubbles (GdomeEvent *self, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_val_if_fail (priv != NULL, FALSE); g_return_val_if_fail (GDOME_XML_IS_EVNT (priv), FALSE); g_return_val_if_fail (exc != NULL, FALSE); return priv->bubbles; } /** * gdome_evt_evnt_cancelable: * @self: Event Object ref * @exc: Exception Object ref * * Returns: If the default action can be prevented the value is %TRUE, else * the value is %FALSE. */ GdomeBoolean gdome_evt_evnt_cancelable (GdomeEvent *self, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_val_if_fail (priv != NULL, FALSE); g_return_val_if_fail (GDOME_XML_IS_EVNT (priv), FALSE); g_return_val_if_fail (exc != NULL, FALSE); return priv->cancelable; } /** * gdome_evt_evnt_currentTarget: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the EventTarget whose EventListeners are currently being * processed. This is particularly useful during capturing and bubbling. */ GdomeEventTarget * gdome_evt_evnt_currentTarget (GdomeEvent *self, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EVNT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); return (GdomeEventTarget *)gdome_xml_n_mkref (priv->currentTarget); } /** * gdome_evt_evnt_eventPhase: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the phase of event flow is currently being evaluated. */ unsigned short gdome_evt_evnt_eventPhase (GdomeEvent *self, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_val_if_fail (priv != NULL, FALSE); g_return_val_if_fail (GDOME_XML_IS_EVNT (priv), FALSE); g_return_val_if_fail (exc != NULL, FALSE); return priv->eventPhase; } /** * gdome_evt_evnt_target: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the EventTarget to which the event was originally dispatched. */ GdomeEventTarget * gdome_evt_evnt_target (GdomeEvent *self, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; GdomeNode *result = NULL; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EVNT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); result = priv->target; gdome_xml_n_ref (result, exc); return (GdomeEventTarget *)result; } /** * gdome_evt_evnt_timeStamp: * @self: Event Object ref * @exc: Exception Object ref * * Returns: the time (in milliseconds relative to the epoch) at which the * event was created. Due to the fact that some systems may not provide this * information the value of timeStamp may be not available for all events. * When not available, a value of 0 will be returned. Examples of epoch time * are the time of the system start or 0:0:0 UTC 1st January 1970. */ GdomeDOMTimeStamp gdome_evt_evnt_timeStamp (GdomeEvent *self, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_val_if_fail (priv != NULL, 0); g_return_val_if_fail (GDOME_XML_IS_EVNT (priv), 0); g_return_val_if_fail (exc != NULL, 0); return priv->timestamp; } /** * gdome_evt_evnt_type: * @self: Event Object ref * @exc: Exception Object ref * * Returns: The name of the event (case-insensitive). The name must be an XML * name. */ GdomeDOMString * gdome_evt_evnt_type (GdomeEvent *self, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_val_if_fail (priv != NULL, NULL); g_return_val_if_fail (GDOME_XML_IS_EVNT (priv), NULL); g_return_val_if_fail (exc != NULL, NULL); return gdome_xml_str_mkref_dup (gdome_evt_evnt_nameOfCode (priv->type)); } /** * gdome_evt_evnt_initEventByCode * * see the documentation for gdome_evt_evnt_initEvent */ void gdome_evt_evnt_initEventByCode (GdomeEvent *self, guint32 eventTypeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EVNT (priv)); g_return_if_fail (exc != NULL); /* todo: If you call this on an internally generated event, there will be memory problems. Maybe we just need a flag for whether it was internally generated or created through DocumentEvent. Maybe another flag to check the "before dispatch" phase. */ priv->type = eventTypeArg; priv->bubbles = canBubbleArg; priv->cancelable = cancelableArg; } /** * gdome_evt_evnt_initEvent: * @self: Event Object ref * @eventTypeArg: Specifies the event type. This type may be any event type * currently defined in this specification or a new event type. * The string must be an XML name. * Any new event type must not begin with any upper, lower, or * mixed case version of the string "DOM". * This prefix is reserved for future DOM event sets. It is * also strongly recommended that third parties adding their * own events use their own prefix to avoid confusion and * lessen the probability of conflicts with other new events. * @canBubbleArg: Specifies whether or not the event can bubble. * @cancelableArg: Specifies whether or not the event's default action can be * prevented. * @exc: Exception Object ref * * The initEvent method is used to initialize the value of an Event created * through the gdome_doc_createEvent() API. This method may only be called * before the Event has been dispatched via the dispatchEvent method, though * it may be called multiple times during that phase if necessary. If called * multiple times the final invocation takes precedence. If called from a * subclass of Event interface only the values specified in the initEvent * method are modified, all other attributes are left unchanged. */ void gdome_evt_evnt_initEvent (GdomeEvent *self, GdomeDOMString *eventTypeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeException *exc) { g_return_if_fail (eventTypeArg != NULL); gdome_evt_evnt_initEventByCode (self, gdome_evt_evnt_codeOfName (eventTypeArg->str), canBubbleArg, cancelableArg, exc); } /** * gdome_evt_evnt_preventDefault: * @self: Event Object ref * @exc: Exception Object ref * * If an event is cancelable, the preventDefault method is used to signify * that the event is to be canceled, meaning any default action normally * taken by the implementation as a result of the event will not occur. If, * during any stage of event flow, the preventDefault method is called the * event is canceled. Any default action associated with the event will not * occur. Calling this method for a non-cancelable event has no effect. Once * preventDefault has been called it will remain in effect throughout the * remainder of the event's propagation. This method may be used during any * stage of event flow. */ void gdome_evt_evnt_preventDefault (GdomeEvent *self, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EVNT (priv)); g_return_if_fail (exc != NULL); if (priv->cancelable) priv->default_prevented = TRUE; } /** * gdome_evt_evnt_stopPropagation: * @self: Event Object ref * @exc: Exception Object ref * * The stopPropagation method is used prevent further propagation of an event * during event flow. If this method is called by any EventListener the event * will cease propagating through the tree. The event will complete dispatch * to all listeners on the current EventTarget before event flow stops. This * method may be used during any stage of event flow. */ void gdome_evt_evnt_stopPropagation (GdomeEvent *self, GdomeException *exc) { Gdome_evt_Event *priv = (Gdome_evt_Event *)self; g_return_if_fail (priv != NULL); g_return_if_fail (GDOME_XML_IS_EVNT (priv)); g_return_if_fail (exc != NULL); priv->propagation_stopped = TRUE; } /** * gdome_evt_evnt_codeOfName: * @name: name of the event * * Returns the internal code corresponding to the event whose name is @name */ guint32 gdome_evt_evnt_codeOfName (const char *name) { unsigned i; for (i = 0; eventNameTypeMap[i].name != NULL && strcmp(eventNameTypeMap[i].name, name); i++) ; if (eventNameTypeMap[i].name != NULL) return eventNameTypeMap[i].code; else return 0; } /** * gdome_evt_evnt_nameOfCode: * @code: code of the event * * Returns the symbolic name corresponding to the event whose code is @code */ const char* gdome_evt_evnt_nameOfCode (unsigned int code) { unsigned i; for (i = 0; eventNameTypeMap[i].name != NULL && eventNameTypeMap[i].code != code; i++) ; if (eventNameTypeMap[i].name != NULL) return eventNameTypeMap[i].name; else return NULL; } gdome2-0.8.1/libgdome/events/gdome-evt-propagation.c0000664000076400007640000001255507705723246016056 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-evt-propagation.c * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2000 Anders Carlsson * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /******************************************************************** ** Helper functions for the Implementation of Event Propagation ** ********************************************************************/ #include #include #include #include "gdome.h" #include "gdome-events.h" #include "gdome-xml-node.h" #include "gdome-evt-event.h" #include "gdome-evt-eventl.h" #include "gdome-evt-propagation.h" typedef struct _Gdome_evt_PropagationEl Gdome_evt_PropagationEl; struct _Gdome_evt_PropagationEl { GdomeEventListener *listener; GdomeNode *target; Gdome_evt_PropagationEl *next; }; static void add_timestamp (GdomeEvent *event) { Gdome_evt_Event *priv = (Gdome_evt_Event *)event; GTimeVal tv; g_get_current_time (&tv); if (priv->timestamp == 0) priv->timestamp = (tv.tv_sec * (long long)1000) + tv.tv_usec / 1000; } void gdome_evt_invokeListeners (Gdome_evt_PropagationEl *list, GdomeEvent *event) { Gdome_evt_PropagationEl *el; Gdome_evt_Event *ev_priv = (Gdome_evt_Event *)event; GdomeException exc = 0; el = list; while (el) { if (!ev_priv->propagation_stopped) { ev_priv->currentTarget = ((Gdome_xml_Node *)el->target)->n; gdome_evntl_handleEvent (el->listener, event, &exc); } gdome_n_unref (el->target, &exc); gdome_evntl_unref (el->listener, &exc); el = el->next; } } void gdome_evt_fireEvent (GdomeEvent *event) { GMemChunk *mem_chunk; Gdome_evt_PropagationEl *el; Gdome_evt_PropagationEl *captureList = NULL; Gdome_evt_PropagationEl *attargetList = NULL; Gdome_evt_PropagationEl *bubbleList = NULL; Gdome_evt_PropagationEl *bubbleList_lastEl = NULL; Gdome_evt_Event *ev_priv = (Gdome_evt_Event *)event; Gdome_xml_Node *priv = (Gdome_xml_Node *)ev_priv->target; Gdome_xml_ListenerList *ll; GdomeException exc = 0; xmlNode *p; mem_chunk = g_mem_chunk_create (Gdome_evt_PropagationEl, 128, G_ALLOC_ONLY); add_timestamp (event); /* Builds capture and bubble propagation lists */ p = priv->n->parent; while (p != NULL) { /* if this node has at least one listener */ if (p->_private != NULL && ((Gdome_xml_Node *)p->_private)->ll != NULL) { Gdome_xml_Node *node = p->_private; /* scans listeners list */ ll = node->ll; while (ll) { /* if the current listener is for this event */ if (ev_priv->type == ll->type) { /* builds a new propagation el */ el = g_chunk_new (Gdome_evt_PropagationEl, mem_chunk); gdome_evntl_ref (ll->listener, &exc); el->listener = ll->listener; gdome_n_ref ((GdomeNode *)node, &exc); el->target = (GdomeNode *)node; el->next = NULL; /* prepends it in the capture list */ if (ll->useCapture) { if (captureList != NULL) { el->next = captureList; } captureList = el; } /* appends it in the bubble list if the event makes bubbles */ else if (ev_priv->bubbles) { if (bubbleList == NULL) { bubbleList = el; } else { g_assert (bubbleList_lastEl != NULL); bubbleList_lastEl->next = el; } bubbleList_lastEl = el; } } ll = ll->next; } } p = p->parent; } /* Builds attarget propagation list */ ll = priv->ll; while (ll) { /* if the current listener is for this event */ if (!ll->useCapture && ev_priv->type == ll->type) { /* builds a new propagation el */ el = g_chunk_new (Gdome_evt_PropagationEl, mem_chunk); gdome_evntl_ref (ll->listener, &exc); el->listener = ll->listener; gdome_n_ref ((GdomeNode *)priv, &exc); el->target = (GdomeNode *)priv; el->next = NULL; /* prepends it in the attarget list */ if (attargetList != NULL) { el->next = attargetList; } attargetList = el; } ll = ll->next; } /* Flow control flags init */ ev_priv->default_prevented = FALSE; ev_priv->propagation_stopped = FALSE; /* CAPTURING PHASE */ if (captureList != NULL) { ev_priv->eventPhase = GDOME_CAPTURING_PHASE; gdome_evt_invokeListeners (captureList, event); } /* AT_TARGET */ if (attargetList != NULL) { ev_priv->eventPhase = GDOME_AT_TARGET; gdome_evt_invokeListeners (attargetList, event); } /* BUBBLING PHASE */ if (bubbleList != NULL) { ev_priv->eventPhase = GDOME_BUBBLING_PHASE; gdome_evt_invokeListeners (bubbleList, event); } g_mem_chunk_destroy (mem_chunk); } gdome2-0.8.1/libgdome/events/gdome-evt-mevent.h0000664000076400007640000001267307705757471015046 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-evt-mevent.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ----------------------------------------------------------------------- */ /* --------------------------- MutationEvent --------------------------- */ /* ----------------------------------------------------------------------- */ #ifndef GDOME_MEVENT_FILE #define GDOME_MEVENT_FILE struct _GdomeMutationEventVtab { GdomeEventVtab super; gushort (*attrChange) (GdomeMutationEvent *self, GdomeException *exc); GdomeDOMString *(*attrName) (GdomeMutationEvent *self, GdomeException *exc); GdomeDOMString *(*newValue) (GdomeMutationEvent *self, GdomeException *exc); GdomeDOMString *(*prevValue) (GdomeMutationEvent *self, GdomeException *exc); GdomeNode *(*relatedNode) (GdomeMutationEvent *self, GdomeException *exc); void (*initMutationEvent) (GdomeMutationEvent *self, GdomeDOMString *typeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeNode *relatedNodeArg, GdomeDOMString *prevValueArg, GdomeDOMString *newValueArg, GdomeDOMString *attrNameArg, gushort attrChangeArg, GdomeException *exc); }; typedef struct _Gdome_evt_MutationEvent Gdome_evt_MutationEvent; struct _Gdome_evt_MutationEvent { GdomeMutationEvent super; const GdomeMutationEventVtab *vtab; GdomeEventType etype; int refcnt; GdomeBoolean bubbles; GdomeBoolean cancelable; xmlNode *currentTarget; unsigned short eventPhase; GdomeNode *target; GdomeDOMTimeStamp timestamp; guint32 *type; GdomeBoolean propagation_stopped; GdomeBoolean default_prevented; unsigned short attrChange; GdomeDOMString *attrName; GdomeDOMString *newValue; GdomeDOMString *prevValue; GdomeNode *relatedNode; }; GdomeMutationEvent * gdome_evt_mevnt_mkref (void); void gdome_evt_mevnt_unref (GdomeEvent *self, GdomeException *exc); gpointer gdome_evt_mevnt_query_interface (GdomeEvent *self, const char *interface, GdomeException *exc); GdomeNode * gdome_evt_mevnt_target (GdomeEvent *self, GdomeException *exc); GdomeNode * gdome_evt_mevnt_relatedNode (GdomeMutationEvent *self, GdomeException *exc); GdomeDOMString * gdome_evt_mevnt_prevValue (GdomeMutationEvent *self, GdomeException *exc); GdomeDOMString * gdome_evt_mevnt_newValue (GdomeMutationEvent *self, GdomeException *exc); GdomeDOMString * gdome_evt_mevnt_attrName (GdomeMutationEvent *self, GdomeException *exc); gushort gdome_evt_mevnt_attrChange (GdomeMutationEvent *self, GdomeException *exc); void gdome_evt_mevnt_initMutationEvent (GdomeMutationEvent *self, GdomeDOMString *typeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeNode *relatedNodeArg, GdomeDOMString *prevValueArg, GdomeDOMString *newValueArg, GdomeDOMString *attrNameArg, gushort attrChangeArg, GdomeException *exc); /* auxiliary functions */ void gdome_evt_mevnt_initMutationEventByCode (GdomeMutationEvent *self, guint32 typeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeNode *relatedNodeArg, GdomeDOMString *prevValueArg, GdomeDOMString *newValueArg, GdomeDOMString *attrNameArg, gushort attrChangeArg, GdomeException *exc); extern const GdomeMutationEventVtab gdome_evt_mevnt_vtab; #endif /* GDOME_MEVENT_FILE */ gdome2-0.8.1/libgdome/events/gdome-evt-eventl.h0000664000076400007640000000643207625205236015025 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-evt-eventl.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ----------------------------------------------------------------------- */ /* --------------------------- EventListener --------------------------- */ /* ----------------------------------------------------------------------- */ #ifndef GDOME_FILE_EVENTL #define GDOME_FILE_EVENTL #include "gdome-events.h" struct _GdomeEventListenerVtab { void (*ref) (GdomeEventListener *self, GdomeException *exc); void (*unref) (GdomeEventListener *self, GdomeException *exc); gpointer (*query_interface) (GdomeEventListener *self, const char *interface, GdomeException *exc); void (*handleEvent) (GdomeEventListener *self, GdomeEvent *evt, GdomeException *exc); }; typedef struct _Gdome_evt_EventListener Gdome_evt_EventListener; struct _Gdome_evt_EventListener { GdomeEventListener super; const GdomeEventListenerVtab *vtab; int refcnt; void (*callback) (GdomeEventListener *self, GdomeEvent *event, GdomeException *exc); gpointer priv; void (*priv_callback) (GdomeEventListener* self); }; GdomeEventListener * gdome_evt_evntl_aux_mkref (void (*callback) (GdomeEventListener *self, GdomeEvent *event, GdomeException *exc), gpointer priv, void (*priv_callback) (GdomeEventListener* self)); GdomeEventListener * gdome_evt_evntl_mkref (void (*callback) (GdomeEventListener *self, GdomeEvent *event, GdomeException *exc), gpointer priv); void gdome_evt_evntl_ref (GdomeEventListener *self, GdomeException *exc); void gdome_evt_evntl_unref (GdomeEventListener *self, GdomeException *exc); gpointer gdome_evt_evntl_query_interface (GdomeEventListener *self, const char *interface, GdomeException *exc); void gdome_evt_evntl_handleEvent (GdomeEventListener *self, GdomeEvent *evt, GdomeException *exc); gpointer gdome_evt_evntl_get_priv (GdomeEventListener *self); extern const GdomeEventListenerVtab gdome_evt_evntl_vtab; #endif /* GDOME_FILE_EVENTL */ gdome2-0.8.1/libgdome/events/gdome-evt-event.h0000664000076400007640000001407307705757471014665 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-evt-event.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2000 Anders Carlsson * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* --------------------------------------------------------------- */ /* --------------------------- Event --------------------------- */ /* --------------------------------------------------------------- */ #ifndef GDOME_EVENT_FILE #define GDOME_EVENT_FILE #include struct _GdomeEventVtab { void (*ref) (GdomeEvent *self, GdomeException *exc); void (*unref) (GdomeEvent *self, GdomeException *exc); gpointer (*query_interface) (GdomeEvent *self, const char *interface, GdomeException *exc); GdomeBoolean (*bubbles) (GdomeEvent *self, GdomeException *exc); GdomeBoolean (*cancelable) (GdomeEvent *self, GdomeException *exc); GdomeEventTarget *(*currentTarget) (GdomeEvent *self, GdomeException *exc); unsigned short (*eventPhase) (GdomeEvent *self, GdomeException *exc); GdomeEventTarget *(*target) (GdomeEvent *self, GdomeException *exc); GdomeDOMTimeStamp (*timeStamp) (GdomeEvent *self, GdomeException *exc); GdomeDOMString *(*type) (GdomeEvent *self, GdomeException *exc); void (*initEvent) (GdomeEvent *self, GdomeDOMString *eventTypeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeException *exc); void (*preventDefault) (GdomeEvent *self, GdomeException *exc); void (*stopPropagation) (GdomeEvent *self, GdomeException *exc); }; typedef struct _Gdome_evt_Event Gdome_evt_Event; struct _Gdome_evt_Event { GdomeEvent super; const GdomeEventVtab *vtab; GdomeEventType etype; int refcnt; GdomeBoolean bubbles; GdomeBoolean cancelable; xmlNode *currentTarget; unsigned short eventPhase; GdomeNode *target; GdomeDOMTimeStamp timestamp; guint32 type; GdomeBoolean propagation_stopped; GdomeBoolean default_prevented; }; GdomeEvent * gdome_evt_evnt_mkref (void); void gdome_evt_evnt_ref (GdomeEvent *self, GdomeException *exc); void gdome_evt_evnt_unref (GdomeEvent *self, GdomeException *exc); gpointer gdome_evt_evnt_query_interface (GdomeEvent *self, const char *interface, GdomeException *exc); GdomeDOMString * gdome_evt_evnt_type (GdomeEvent *self, GdomeException *exc); GdomeEventTarget * gdome_evt_evnt_target (GdomeEvent *self, GdomeException *exc); GdomeEventTarget * gdome_evt_evnt_currentTarget (GdomeEvent *self, GdomeException *exc); unsigned short gdome_evt_evnt_eventPhase (GdomeEvent *self, GdomeException *exc); GdomeBoolean gdome_evt_evnt_bubbles (GdomeEvent *self, GdomeException *exc); GdomeBoolean gdome_evt_evnt_cancelable (GdomeEvent *self, GdomeException *exc); GdomeDOMTimeStamp gdome_evt_evnt_timeStamp (GdomeEvent *self, GdomeException *exc); void gdome_evt_evnt_stopPropagation (GdomeEvent *self, GdomeException *exc); void gdome_evt_evnt_preventDefault (GdomeEvent *self, GdomeException *exc); void gdome_evt_evnt_initEvent (GdomeEvent *self, GdomeDOMString *eventTypeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeException *exc); /* The following are constants corresponding to the * event types that Gdome2 can handle. These constants * are used internally only and should not be exposed to the * public API */ enum _Gdome_xml_EventCodes { DOM_SUBTREE_MODIFIED_EVENT_TYPE = 0x01, DOM_NODE_INSERTED_EVENT_TYPE = 0x02, DOM_NODE_REMOVED_EVENT_TYPE = 0x04, DOM_NODE_REMOVED_FROM_DOCUMENT_EVENT_TYPE = 0x08, DOM_NODE_INSERTED_INTO_DOCUMENT_EVENT_TYPE = 0x10, DOM_ATTR_MODIFIED_EVENT_TYPE = 0x20, DOM_CHARACTER_DATA_MODIFIED_EVENT_TYPE = 0x40, DOM_ALL_EVENT_TYPES = (-1) }; /* Some auxiliary functions */ guint32 gdome_evt_evnt_codeOfName (const char *name); const char* gdome_evt_evnt_nameOfCode (guint32 code); void gdome_evt_evnt_initEventByCode (GdomeEvent *self, guint32 eventTypeArg, GdomeBoolean canBubbleArg, GdomeBoolean cancelableArg, GdomeException *exc); extern const GdomeEventVtab gdome_evt_evnt_vtab; #endif /* GDOME_EVENT_FILE */ gdome2-0.8.1/libgdome/events/gdome-evt-propagation.h0000664000076400007640000000230607653226707016056 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-evt-propagation.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2000 Anders Carlsson * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_EVT_PROPUTIL_H #define GDOME_XML_PROPUTIL_H void gdome_evt_fireEvent (GdomeEvent *event); #endif /* GDOME_EVT_PROPUTIL_H */ gdome2-0.8.1/libgdome/events/gdome-evt-util.h0000664000076400007640000000277207377235715014521 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-evt-util.h * * Copyright (C) 1999 Raph Levien * Copyright (C) 2000 Mathieu Lacage * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_EVTUTIL_FILE #define GDOME_EVTUTIL_FILE #include "gdome-xml-util.h" #include "gdome-events.h" /* EventTarget are Nodes in fact... */ #define GDOME_XML_IS_EVNTT(evntt) GDOME_XML_IS_N(evntt) #define GDOME_XML_IS_EVNTL(evntl) 1 #define GDOME_XML_IS_EVNT(evnt) \ ((Gdome_evt_Event *) evnt)->etype == GDOME_BASE_EVENT || \ ((Gdome_evt_Event *) evnt)->etype == GDOME_MUTATION_EVENT #define GDOME_XML_IS_MEVNT(mevnt) \ ((Gdome_evt_Event *) mevnt)->etype == GDOME_MUTATION_EVENT #endif /* GDOME_EVTUTIL_FILE */ gdome2-0.8.1/libgdome/xpath/0000777000076400007640000000000007740102242011356 5gdome2-0.8.1/libgdome/xpath/Makefile.in0000664000076400007640000002071707740102242013350 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EXEEXT = @EXEEXT@ GDOME_INCLUDEDIR = @GDOME_INCLUDEDIR@ GDOME_LIBDIR = @GDOME_LIBDIR@ GDOME_LIBS = @GDOME_LIBS@ GDOME_VERSION_INFO = @GDOME_VERSION_INFO@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MIN_VERSION = @GLIB_MIN_VERSION@ GLIB_MKENUMS = @GLIB_MKENUMS@ GLIB_REQUIRED = @GLIB_REQUIRED@ GOBJECT_QUERY = @GOBJECT_QUERY@ HTML_DIR = @HTML_DIR@ LDFLAGS = @LDFLAGS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_MIN_VERSION = @XML_MIN_VERSION@ NULL = INCLUDES = \ -I$(top_srcdir)/libgdome \ -I$(top_srcdir)/libgdome/gdomecore \ $(LIBXML_CFLAGS) \ $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) noinst_LTLIBRARIES = libgdomexpath.la libgdomexpath_la_SOURCES = \ gdome-xpath-xpeval.c \ gdome-xpath-xpnsresolv.c \ gdome-xpath-xpresult.c \ $(NULL) EXTRA_DIST = \ gdome-xpath-xpeval.h \ gdome-xpath-xpnsresolv.h \ gdome-xpath-xpresult.h \ $(NULL) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../../config.h CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) DEFS = @DEFS@ -I. -I$(srcdir) -I../.. LIBS = @LIBS@ libgdomexpath_la_LDFLAGS = libgdomexpath_la_LIBADD = libgdomexpath_la_OBJECTS = gdome-xpath-xpeval.lo \ gdome-xpath-xpnsresolv.lo gdome-xpath-xpresult.lo 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 = $(libgdomexpath_la_SOURCES) OBJECTS = $(libgdomexpath_la_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps libgdome/xpath/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-noinstLTLIBRARIES: clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) distclean-noinstLTLIBRARIES: maintainer-clean-noinstLTLIBRARIES: .c.o: $(COMPILE) -c $< # FIXME: We should only use cygpath when building on Windows, # and only if it is available. .c.obj: $(COMPILE) -c `cygpath -w $<` .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core -rm -f *.$(OBJEXT) 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: libgdomexpath.la: $(libgdomexpath_la_OBJECTS) $(libgdomexpath_la_DEPENDENCIES) $(LINK) $(libgdomexpath_la_LDFLAGS) $(libgdomexpath_la_OBJECTS) $(libgdomexpath_la_LIBADD) $(LIBS) 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 = libgdome/xpath 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-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile $(LTLIBRARIES) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: 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-noinstLTLIBRARIES mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-noinstLTLIBRARIES clean-compile clean-libtool \ clean-tags clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-noinstLTLIBRARIES distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-noinstLTLIBRARIES \ 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-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \ clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \ 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 # libgdomeincdir = $(includedir)/libgdome # 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: gdome2-0.8.1/libgdome/xpath/Makefile.am0000664000076400007640000000075407437576331013357 NULL = INCLUDES = \ -I$(top_srcdir)/libgdome \ -I$(top_srcdir)/libgdome/gdomecore \ $(LIBXML_CFLAGS) \ $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) noinst_LTLIBRARIES = libgdomexpath.la libgdomexpath_la_SOURCES = \ gdome-xpath-xpeval.c \ gdome-xpath-xpnsresolv.c \ gdome-xpath-xpresult.c \ $(NULL) EXTRA_DIST = \ gdome-xpath-xpeval.h \ gdome-xpath-xpnsresolv.h \ gdome-xpath-xpresult.h \ $(NULL) # libgdomeincdir = $(includedir)/libgdome gdome2-0.8.1/libgdome/xpath/gdome-xpath-xpeval.c0000664000076400007640000001360607437573206015177 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xpath-xpeval.c * * CopyRight (C) 2002 T.J. Mather * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 #include #include "gdome.h" #include "gdome-xpath.h" #include "gdome-xpath-xpeval.h" #include "gdome-xpath-xpnsresolv.h" #include "gdome-xpath-xpresult.h" #include "gdome-xml-node.h" Gdome_xpath_XPathEvaluator *gdome_xpath_XPathEvaluator = NULL; const GdomeXPathEvaluatorVtab gdome_xpath_xpeval_vtab = { gdome_xpath_xpeval_ref, gdome_xpath_xpeval_unref, gdome_xpath_xpeval_createNSResolver, gdome_xpath_xpeval_createResult, gdome_xpath_xpeval_evaluate }; /** * gdome_xpath_xpeval_mkref: * * Constructor of the XPathEvaluator interface. * Returns: the reference to the XPathEvaluator structure. */ GdomeXPathEvaluator * gdome_xpath_xpeval_mkref (void) { if (gdome_xpath_XPathEvaluator == NULL) { gdome_xpath_XPathEvaluator = g_new (Gdome_xpath_XPathEvaluator, 1); gdome_xpath_XPathEvaluator->refcnt = 1; gdome_xpath_XPathEvaluator->vtab = &gdome_xpath_xpeval_vtab; } else gdome_xpath_XPathEvaluator->refcnt++; return (GdomeXPathEvaluator *)gdome_xpath_XPathEvaluator; } /** * gdome_xpath_xpeval_ref: * @self: XPathEvaluator Object ref * @exc: Exception Object ref * * Increase the reference count of the XPathEvaluator structure. */ void gdome_xpath_xpeval_ref (GdomeXPathEvaluator *self, GdomeException *exc) { Gdome_xpath_XPathEvaluator *priv = (Gdome_xpath_XPathEvaluator *)self; g_return_if_fail (self != NULL); g_return_if_fail (exc != NULL); g_assert(self == (GdomeXPathEvaluator *)gdome_xpath_XPathEvaluator); priv->refcnt++; } /** * gdome_xpath_xpeval_unref: * @self: XPathEvaluator Object ref * @exc: Exception Object ref * * Decrease the reference count of the XPathEvaluator. Free the structure * if XPathEvaluator will have zero reference. */ void gdome_xpath_xpeval_unref (GdomeXPathEvaluator *self, GdomeException *exc) { Gdome_xpath_XPathEvaluator *priv = (Gdome_xpath_XPathEvaluator *)self; g_return_if_fail (self != NULL); g_return_if_fail (exc != NULL); g_assert(self == (GdomeXPathEvaluator *)gdome_xpath_XPathEvaluator); g_assert(priv->refcnt > 0); priv->refcnt--; if (priv->refcnt == 0) { g_free (self); gdome_xpath_XPathEvaluator = NULL; } } /** * gdome_xpath_xpeval_createNSResolver: * @self: GdomeXPathEvaluator Object ref * @nodeResolver: The node to be used as a context for namespace resolution. * @exc: Exception Object ref * * Adapts any DOM node to resolve namespaces so that an XPath expression * can be easily evaluated relative to the context of the node where it * appeared within the document. * Returns: GdomeXPathNSResolver object. */ GdomeXPathNSResolver * gdome_xpath_xpeval_createNSResolver (GdomeXPathEvaluator *self, GdomeNode *nodeResolver, GdomeException *exc) { return (GdomeXPathNSResolver *)gdome_xpath_xpnsresolv_mkref(nodeResolver); } /** * gdome_xpath_xpeval_createResult: * @self: GdomeXPathEvaluator Object ref * @exc: Exception Object ref * * Returns: an GdomeXPathResult object which may be passed as a parameter to the * evaluation methods of this GdomeXPathEvaluator so that a new one is not * created on each call to an evaluation method. */ GdomeXPathResult * gdome_xpath_xpeval_createResult (GdomeXPathEvaluator *self, GdomeException *exc) { return gdome_xpath_xpresult_mkref(NULL, NULL); } /** * gdome_xpath_xpeval_evaluate: * @self: GdomeXPathEvaluator Object ref * @expression: The XPath expression string to be parsed and evaluated. * @contextNode: Context node for the evaluation of this XPath expression. * @resolver: The resolver permits translation of prefixes within the XPath * expression into appropriate namespace URIs. * @type: If specified, result will be coerced to return the specified type. * @result: Specifies a GdomeXPathResult object to be re-used. * @exc: Exception Object ref * * Evaluates an XPath expression string * Returns: a result of the specified type if possible. */ GdomeXPathResult * gdome_xpath_xpeval_evaluate (GdomeXPathEvaluator *self, GdomeDOMString *expression, GdomeNode *contextNode, GdomeXPathNSResolver *resolver, unsigned int type, GdomeXPathResult *result, GdomeException *exc) { xmlXPathObjectPtr res = NULL; xmlXPathContextPtr ctxt; xmlNodePtr refNode; xmlChar *path; Gdome_xml_Node *cn = (Gdome_xml_Node *)contextNode; Gdome_xpath_XPathNSResolver *resolv = (Gdome_xpath_XPathNSResolver *)resolver; g_return_val_if_fail (expression != NULL, NULL); refNode = cn->n; ctxt = xmlXPathNewContext( refNode->doc ); ctxt->node = refNode; if (resolv != NULL) { ctxt->namespaces = xmlGetNsList(resolv->n->doc, resolv->n); ctxt->nsNr = 0; if (ctxt->namespaces != NULL) { while (ctxt->namespaces[ctxt->nsNr] != NULL) ctxt->nsNr++; } } path = expression->str; res = xmlXPathEval( path, ctxt ); /* XML::LibXML should also have this patch... */ if (ctxt->namespaces != NULL) xmlFree(ctxt->namespaces); xmlXPathFreeContext(ctxt); return gdome_xpath_xpresult_mkref(contextNode, res); } gdome2-0.8.1/libgdome/xpath/gdome-xpath-xpnsresolv.c0000664000076400007640000000703307437573233016120 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xpath-xpnsresolv.c * * CopyRight (C) 2002 T.J. Mather * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 #include #include "gdome.h" #include "gdome-xml-node.h" #include "gdome-xpath.h" #include "gdome-xpath-xpnsresolv.h" const GdomeXPathNSResolverVtab gdome_xpath_xpnsresolv_vtab = { gdome_xpath_xpnsresolv_ref, gdome_xpath_xpnsresolv_unref, gdome_xpath_xpnsresolv_lookupNamespaceURI }; GdomeXPathNSResolver * gdome_xpath_xpnsresolv_mkref( GdomeNode *nodeResolver ) { Gdome_xml_Node *priv = (Gdome_xml_Node *)nodeResolver; Gdome_xpath_XPathNSResolver *resolv = g_new (Gdome_xpath_XPathNSResolver, 1); GdomeException exc; resolv->vtab = &gdome_xpath_xpnsresolv_vtab; resolv->n = priv->n; resolv->refcnt = 1; resolv->gnode = nodeResolver; gdome_xml_n_ref ( nodeResolver, &exc); return (GdomeXPathNSResolver *)resolv; } /** * gdome_xpath_xpnsresolv_ref: * @self: XPathNSResolver Object ref * @exc: Exception Object ref * * Increase the reference count of the XPathNSResolver structure. */ void gdome_xpath_xpnsresolv_ref (GdomeXPathNSResolver *self, GdomeException *exc) { Gdome_xpath_XPathNSResolver *priv = (Gdome_xpath_XPathNSResolver *)self; g_return_if_fail (self != NULL); g_return_if_fail (exc != NULL); priv->refcnt++; } /** * gdome_xpath_xpnsresolv_unref: * @self: XPathNSResolver Object ref * @exc: Exception Object ref * * Decrease the reference count of the XPathNSResolver. Free the structure * if XPathNSResolver will have zero reference. */ void gdome_xpath_xpnsresolv_unref (GdomeXPathNSResolver *self, GdomeException *exc) { Gdome_xpath_XPathNSResolver *priv = (Gdome_xpath_XPathNSResolver *)self; g_return_if_fail (self != NULL); g_return_if_fail (exc != NULL); g_assert(priv->refcnt > 0); priv->refcnt--; if (priv->refcnt == 0) { gdome_xml_n_unref (priv->gnode, exc); g_free (self); } } /** * gdome_xpath_xpnsresolv_lookupNamespaceURI: * @self: GdomeXPathNSResolver Object ref * @prefix: The prefix of the namespace to look for * @exc: Exception Object ref * * Look up the namespace URI associated to the given namespace prefix. The * XPath evaluator must never call this with a null or empty argument, because * the result of doing this is undefined. * Returns: namespace URI */ GdomeDOMString * gdome_xpath_xpnsresolv_lookupNamespaceURI( GdomeXPathNSResolver *self, GdomeDOMString *prefix, GdomeException *exc) { xmlNsPtr ns = NULL; Gdome_xpath_XPathNSResolver *priv = (Gdome_xpath_XPathNSResolver *)self; ns = xmlSearchNs(priv->n->doc, priv->n, prefix->str); if (ns != NULL) { return gdome_str_mkref_own ((gchar *)ns->href); } else { return NULL; } } gdome2-0.8.1/libgdome/xpath/gdome-xpath-xpresult.c0000664000076400007640000001470007457074267015567 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xpath-xpresult.c * * CopyRight (C) 2002 T.J. Mather * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; 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 #include "gdome.h" #include "gdome-xpath.h" #include "gdome-xpath-xpresult.h" #include "gdome-xml-node.h" const GdomeXPathResultVtab gdome_xpath_xpresult_vtab = { gdome_xpath_xpresult_ref, gdome_xpath_xpresult_unref, gdome_xpath_xpresult_resultType, gdome_xpath_xpresult_booleanValue, gdome_xpath_xpresult_numberValue, gdome_xpath_xpresult_stringValue, gdome_xpath_xpresult_singleNodeValue, gdome_xpath_xpresult_iterateNext }; GdomeXPathResult * gdome_xpath_xpresult_mkref (GdomeNode *gnode, xmlXPathObjectPtr res) { Gdome_xpath_XPathResult *result = NULL; GdomeException exc; result = g_new (Gdome_xpath_XPathResult, 1); result->res = res; result->refcnt = 1; result->gnode = gnode; result->pos = 0; result->vtab = &gdome_xpath_xpresult_vtab; gdome_xml_n_ref (gnode, &exc); return (GdomeXPathResult *)result; } /** * gdome_xpath_xpresult_ref: * @self: XPathResult Object ref * @exc: Exception Object ref * * Increase the reference count of the XPathResult structure. */ void gdome_xpath_xpresult_ref (GdomeXPathResult *self, GdomeException *exc) { Gdome_xpath_XPathResult *priv = (Gdome_xpath_XPathResult *)self; g_return_if_fail (self != NULL); g_return_if_fail (exc != NULL); priv->refcnt++; } /** * gdome_xpath_xpresult_unref: * @self: XPathResult Object ref * @exc: Exception Object ref * * Decrease the reference count of the XPathResult. Free the structure * if XPathResult will have zero reference. */ void gdome_xpath_xpresult_unref (GdomeXPathResult *self, GdomeException *exc) { Gdome_xpath_XPathResult *priv = (Gdome_xpath_XPathResult *)self; g_return_if_fail (self != NULL); g_return_if_fail (exc != NULL); g_assert(priv->refcnt > 0); priv->refcnt--; if (priv->refcnt == 0) { gdome_xml_n_unref (priv->gnode, exc); /* xmlXPathFreeNodeSet(priv->res->nodesetval); priv->res->nodesetval = 0;*/ xmlXPathFreeObject(priv->res); g_free (self); } } /** * gdome_xpath_xpresult_resultType: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Returns: a code representing the type of this result, as defined by the type * constants. */ unsigned short gdome_xpath_xpresult_resultType (GdomeXPathResult *self, GdomeException *exc) { Gdome_xpath_XPathResult *result = (Gdome_xpath_XPathResult *) self; if (result->res == NULL) { return GDOME_ANY_TYPE; } else { switch (result->res->type) { case XPATH_NODESET: return GDOME_ORDERED_NODE_ITERATOR_TYPE; case XPATH_BOOLEAN: return GDOME_BOOLEAN_TYPE; case XPATH_NUMBER: return GDOME_NUMBER_TYPE; case XPATH_STRING: return GDOME_STRING_TYPE; default: return GDOME_ANY_TYPE; } } } /** * gdome_xpath_xpresult_booleanValue: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Returns: the value of this boolean result. */ GdomeBoolean gdome_xpath_xpresult_booleanValue (GdomeXPathResult *self, GdomeException *exc) { Gdome_xpath_XPathResult *result = (Gdome_xpath_XPathResult *) self; if (result->res->type == XPATH_BOOLEAN) { return result->res->boolval; } else { *exc = GDOME_TYPE_ERR; return 0; } } /** * gdome_xpath_xpresult_numberValue: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Returns: the value of this number result. */ double gdome_xpath_xpresult_numberValue (GdomeXPathResult *self, GdomeException *exc) { Gdome_xpath_XPathResult *result = (Gdome_xpath_XPathResult *) self; if (result->res->type == XPATH_NUMBER) { return result->res->floatval; } else { *exc = GDOME_TYPE_ERR; return 0; } } /** * gdome_xpath_xpresult_stringValue: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Returns: the value of this GdomeDOMString result. */ GdomeDOMString * gdome_xpath_xpresult_stringValue (GdomeXPathResult *self, GdomeException *exc) { Gdome_xpath_XPathResult *result = (Gdome_xpath_XPathResult *) self; if (result->res->type == XPATH_STRING) { return gdome_str_mkref_dup (result->res->stringval); } else { *exc = GDOME_TYPE_ERR; return NULL; } } /** * gdome_xpath_xpresult_singleNodeValue: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Returns: The value of this single node result, which may be %NULL. This result is not * guaranteed to be the first node in document order where the expression * evaluates to multiple nodes. */ GdomeNode * gdome_xpath_xpresult_singleNodeValue (GdomeXPathResult *self, GdomeException *exc) { xmlNodeSetPtr nodelist = NULL; Gdome_xpath_XPathResult *result = (Gdome_xpath_XPathResult *) self; if (result->res->type == XPATH_NODESET) { nodelist = result->res->nodesetval; if ( nodelist && nodelist->nodeNr > 0 ) { return (GdomeNode *)gdome_xml_n_mkref (nodelist->nodeTab[0]); } else { return NULL; } } else { *exc = GDOME_TYPE_ERR; return NULL; } } /** * gdome_xpath_xpresult_iterateNext: * @self: GdomeXPathResult Object ref * @exc: Exception Object ref * * Iterates and returns the next node from the node set or %NULL if there * are no more nodes. * Returns: the next node. */ GdomeNode * gdome_xpath_xpresult_iterateNext (GdomeXPathResult *self, GdomeException *exc) { Gdome_xpath_XPathResult *result = (Gdome_xpath_XPathResult *) self; xmlNodeSetPtr nsp = result->res->nodesetval; int pos = result->pos; xmlNodePtr tnode; if (nsp == NULL) return NULL; if (pos >= nsp->nodeNr) return NULL; tnode = nsp->nodeTab[pos]; result->pos++; return gdome_xml_n_mkref (tnode); } gdome2-0.8.1/libgdome/xpath/gdome-xpath-xpeval.h0000664000076400007640000000522107470410752015167 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xpath-xpeval.h * * CopyRight (C) 2002 T.J. Mather * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_XPEVAL_FILE #define GDOME_XPEVAL_FILE struct _GdomeXPathEvaluatorVtab { void (*ref) (GdomeXPathEvaluator *self, GdomeException *exc); void (*unref) (GdomeXPathEvaluator *self, GdomeException *exc); GdomeXPathNSResolver *(*createNSResolver) (GdomeXPathEvaluator *self, GdomeNode *nodeResolver, GdomeException *exc); GdomeXPathResult *(*createResult) (GdomeXPathEvaluator *self, GdomeException *exc); GdomeXPathResult *(*evaluate) (GdomeXPathEvaluator *self, GdomeDOMString *expression, GdomeNode *contextNode, GdomeXPathNSResolver *resolver, unsigned int type, GdomeXPathResult *result, GdomeException *exc); }; typedef struct _Gdome_xpath_XPathEvaluator Gdome_xpath_XPathEvaluator; struct _Gdome_xpath_XPathEvaluator { const GdomeXPathEvaluatorVtab *vtab; int refcnt; GdomeXPathResult *createResult; GdomeXPathNSResolver *createNSResolver; GdomeXPathResult *evaluate; }; GdomeXPathEvaluator * gdome_xpath_xpeval_mkref (void); void gdome_xpath_xpeval_ref (GdomeXPathEvaluator *self, GdomeException *exc); void gdome_xpath_xpeval_unref (GdomeXPathEvaluator *self, GdomeException *exc); GdomeXPathNSResolver * gdome_xpath_xpeval_createNSResolver (GdomeXPathEvaluator *self, GdomeNode *nodeResolver, GdomeException *exc); GdomeXPathResult * gdome_xpath_xpeval_createResult (GdomeXPathEvaluator *self, GdomeException *exc); GdomeXPathResult * gdome_xpath_xpeval_evaluate (GdomeXPathEvaluator *self, GdomeDOMString *expression, GdomeNode *contextNode, GdomeXPathNSResolver *resolver, unsigned int type, GdomeXPathResult *result, GdomeException *exc); extern const GdomeXPathEvaluatorVtab gdome_xpath_xpeval_vtab; #endif /* GDOME_XPEVAL_FILE */ gdome2-0.8.1/libgdome/xpath/gdome-xpath-xpnsresolv.h0000664000076400007640000000362407435532411016116 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xpath-xpnsresolv.h * * CopyRight (C) 2002 T.J. Mather * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_XPNSRESOLV_FILE #define GDOME_XPNSRESOLV_FILE struct _GdomeXPathNSResolverVtab { void (*ref) (GdomeXPathNSResolver *self, GdomeException *exc); void (*unref) (GdomeXPathNSResolver *self, GdomeException *exc); GdomeDOMString *(*lookupNamespaceURI) (GdomeXPathNSResolver *self, GdomeDOMString *prefix, GdomeException *exc); }; typedef struct _Gdome_xpath_XPathNSResolver Gdome_xpath_XPathNSResolver; struct _Gdome_xpath_XPathNSResolver { const GdomeXPathNSResolverVtab *vtab; int refcnt; GdomeNode *gnode; xmlNodePtr n; }; GdomeXPathNSResolver * gdome_xpath_xpnsresolv_mkref( GdomeNode *nodeResolver ); void gdome_xpath_xpnsresolv_ref (GdomeXPathNSResolver *self, GdomeException *exc); void gdome_xpath_xpnsresolv_unref (GdomeXPathNSResolver *self, GdomeException *exc); GdomeDOMString * gdome_xpath_xpnsresolv_lookupNamespaceURI( GdomeXPathNSResolver *self, GdomeDOMString *prefix, GdomeException *exc); const GdomeXPathNSResolverVtab gdome_xpath_xpnsresolv_vtab; #endif /* GDOME_XPNSRESOLV_FILE */ gdome2-0.8.1/libgdome/xpath/gdome-xpath-xpresult.h0000664000076400007640000000551107470410752015560 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* gdome-xpath-xpresult.h * * CopyRight (C) 2002 T.J. Mather * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GDOME_XPRESULT_FILE #define GDOME_XPRESULT_FILE #include struct _GdomeXPathResultVtab { void (*ref) (GdomeXPathResult *self, GdomeException *exc); void (*unref) (GdomeXPathResult *self, GdomeException *exc); unsigned short (*resultType) (GdomeXPathResult *self, GdomeException *exc); GdomeBoolean (*booleanValue) (GdomeXPathResult *self, GdomeException *exc); double (*numberValue) (GdomeXPathResult *self, GdomeException *exc); GdomeDOMString * (*stringValue) (GdomeXPathResult *self, GdomeException *exc); GdomeNode * (*singleNodeValue) (GdomeXPathResult *self, GdomeException *exc); GdomeNode *(*iterateNext) (GdomeXPathResult *self, GdomeException *exc); }; typedef struct _Gdome_xpath_XPathResult Gdome_xpath_XPathResult; struct _Gdome_xpath_XPathResult { const GdomeXPathResultVtab *vtab; int refcnt; xmlXPathObjectPtr res; GdomeNode *gnode; int pos; }; void gdome_xpath_xpresult_ref (GdomeXPathResult *self, GdomeException *exc); void gdome_xpath_xpresult_unref (GdomeXPathResult *self, GdomeException *exc); GdomeXPathResult * gdome_xpath_xpresult_mkref (GdomeNode *gnode, xmlXPathObjectPtr res); unsigned short gdome_xpath_xpresult_resultType (GdomeXPathResult *self, GdomeException *exc); GdomeBoolean gdome_xpath_xpresult_booleanValue (GdomeXPathResult *self, GdomeException *exc); double gdome_xpath_xpresult_numberValue (GdomeXPathResult *self, GdomeException *exc); GdomeDOMString * gdome_xpath_xpresult_stringValue (GdomeXPathResult *self, GdomeException *exc); GdomeNode * gdome_xpath_xpresult_singleNodeValue (GdomeXPathResult *self, GdomeException *exc); GdomeNode * gdome_xpath_xpresult_iterateNext (GdomeXPathResult *self, GdomeException *exc); extern const GdomeXPathResultVtab gdome_xpath_xpresult_vtab; #endif /* GDOME_XPRESULT_FILE */ gdome2-0.8.1/test/0000777000076400007640000000000007740102243007430 5gdome2-0.8.1/test/Makefile.in0000664000076400007640000004750007740102243011421 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EXEEXT = @EXEEXT@ GDOME_INCLUDEDIR = @GDOME_INCLUDEDIR@ GDOME_LIBDIR = @GDOME_LIBDIR@ GDOME_LIBS = @GDOME_LIBS@ GDOME_VERSION_INFO = @GDOME_VERSION_INFO@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MIN_VERSION = @GLIB_MIN_VERSION@ GLIB_MKENUMS = @GLIB_MKENUMS@ GLIB_REQUIRED = @GLIB_REQUIRED@ GOBJECT_QUERY = @GOBJECT_QUERY@ HTML_DIR = @HTML_DIR@ LDFLAGS = @LDFLAGS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_MIN_VERSION = @XML_MIN_VERSION@ NULL = SUBDIRS = \ apigen \ $(NULL) INCLUDES = \ -DLOCALDIR=\""$(srcdir)"\" \ -I$(srcdir) \ -I$(top_srcdir)/libgdome \ -I$(top_srcdir)/libgdome/gdomecore \ $(LIBXML_CFLAGS) $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) noinst_PROGRAMS = \ test-document \ test-node \ test-cdata \ test-dtd \ test-element \ test-nodelist \ test-namednodemap \ examplea \ exampleb \ examplec \ test-mevents \ test-loadsave \ test-str \ test-treegc \ test-xpath \ test-importnode \ bench \ $(NULL) DEPS = $(top_builddir)/libgdome/libgdome.la LDADDS = $(top_builddir)/libgdome/libgdome.la $(LIBXML_LIBS) $(GLIB_LIBS) test_document_SOURCES = test-document.c test_document_LDFLAGS = test_document_DEPENDENCIES = $(DEPS) test_document_LDADD = $(LDADDS) test_node_SOURCES = test-node.c test_node_LDFLAGS = test_node_DEPENDENCIES = $(DEPS) test_node_LDADD = $(LDADDS) test_cdata_SOURCES = test-cdata.c test_cdata_LDFLAGS = test_cdata_DEPENDENCIES = $(DEPS) test_cdata_LDADD = $(LDADDS) test_dtd_SOURCES = test-dtd.c test_dtd_LDFLAGS = test_dtd_DEPENDENCIES = $(DEPS) test_dtd_LDADD = $(LDADDS) test_element_SOURCES = test-element.c test_element_LDFLAGS = test_element_DEPENDENCIES = $(DEPS) test_element_LDADD = $(LDADDS) test_nodelist_SOURCES = test-nodelist.c test_nodelist_LDFLAGS = test_nodelist_DEPENDENCIES = $(DEPS) test_nodelist_LDADD = $(LDADDS) test_namednodemap_SOURCES = test-namednodemap.c test_namednodemap_LDFLAGS = test_namednodemap_DEPENDENCIES = $(DEPS) test_namednodemap_LDADD = $(LDADDS) examplea_SOURCES = examplea.c examplea_LDFLAGS = examplea_DEPENDENCIES = $(DEPS) examplea_LDADD = $(LDADDS) exampleb_SOURCES = exampleb.c exampleb_LDFLAGS = exampleb_DEPENDENCIES = $(DEPS) exampleb_LDADD = $(LDADDS) examplec_SOURCES = examplec.c examplec_LDFLAGS = examplec_DEPENDENCIES = $(DEPS) examplec_LDADD = $(LDADDS) test_mevents_SOURCES = test-mevents.c test_mevents_LDFLAGS = test_mevents_DEPENDENCIES = $(DEPS) test_mevents_LDADD = $(LDADDS) test_loadsave_SOURCES = test-loadsave.c test_loadsave_LDFLAGS = test_loadsave_DEPENDENCIES = $(DEPS) test_loadsave_LDADD = $(LDADDS) test_str_SOURCES = test-str.c test_str_LDFLAGS = test_str_DEPENDENCIES = $(DEPS) test_str_LDADD = $(LDADDS) test_treegc_SOURCES = test-treegc.c test_treegc_LDFLAGS = test_treegc_DEPENDENCIES = $(DEPS) test_treegc_LDADD = $(LDADDS) test_xpath_SOURCES = test-xpath.c test_xpath_LDFLAGS = test_xpath_DEPENDENCIES = $(DEPS) test_xpath_LDADD = $(LDADDS) test_importnode_SOURCES = test-importnode.c test_importnode_LDFLAGS = test_importnode_DEPENDENCIES = $(DEPS) test_importnode_LDADD = $(LDADDS) bench_SOURCES = bench.c bench_LDFLAGS = bench_DEPENDENCIES = $(DEPS) bench_LDADD = $(LDADDS) EXTRA_DIST = \ exampleb.xml \ examplec.xml \ test-document2.xml \ test-document3.xml \ test-dtd.xml \ test-dtd.dtd \ test-element.xml \ test-node.xml \ test-nodelist.xml \ test-namednodemap.xml \ test-mevents.xml \ test-loadsave1.xml \ test-loadsave2.xml \ test.xml \ test-treegc.xml \ test-xpath.xml \ $(NULL) TESTS_ENVIROMENT = \ LD_LIBRARY_PATH=$(top_builddir)/libgdome/ \ $(NULL) TESTS = \ test-document \ test-node \ test-cdata \ test-dtd \ test-element \ test-nodelist \ test-namednodemap \ examplea \ exampleb \ examplec \ test-mevents \ test-loadsave \ test-str \ test-treegc \ test-xpath \ test-importnode \ $(NULL) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = noinst_PROGRAMS = test-document$(EXEEXT) test-node$(EXEEXT) \ test-cdata$(EXEEXT) test-dtd$(EXEEXT) test-element$(EXEEXT) \ test-nodelist$(EXEEXT) test-namednodemap$(EXEEXT) examplea$(EXEEXT) \ exampleb$(EXEEXT) examplec$(EXEEXT) test-mevents$(EXEEXT) \ test-loadsave$(EXEEXT) test-str$(EXEEXT) test-treegc$(EXEEXT) \ test-xpath$(EXEEXT) test-importnode$(EXEEXT) bench$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I.. LIBS = @LIBS@ test_document_OBJECTS = test-document.$(OBJEXT) test_node_OBJECTS = test-node.$(OBJEXT) test_cdata_OBJECTS = test-cdata.$(OBJEXT) test_dtd_OBJECTS = test-dtd.$(OBJEXT) test_element_OBJECTS = test-element.$(OBJEXT) test_nodelist_OBJECTS = test-nodelist.$(OBJEXT) test_namednodemap_OBJECTS = test-namednodemap.$(OBJEXT) examplea_OBJECTS = examplea.$(OBJEXT) exampleb_OBJECTS = exampleb.$(OBJEXT) examplec_OBJECTS = examplec.$(OBJEXT) test_mevents_OBJECTS = test-mevents.$(OBJEXT) test_loadsave_OBJECTS = test-loadsave.$(OBJEXT) test_str_OBJECTS = test-str.$(OBJEXT) test_treegc_OBJECTS = test-treegc.$(OBJEXT) test_xpath_OBJECTS = test-xpath.$(OBJEXT) test_importnode_OBJECTS = test-importnode.$(OBJEXT) bench_OBJECTS = bench.$(OBJEXT) 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 = $(test_document_SOURCES) $(test_node_SOURCES) $(test_cdata_SOURCES) $(test_dtd_SOURCES) $(test_element_SOURCES) $(test_nodelist_SOURCES) $(test_namednodemap_SOURCES) $(examplea_SOURCES) $(exampleb_SOURCES) $(examplec_SOURCES) $(test_mevents_SOURCES) $(test_loadsave_SOURCES) $(test_str_SOURCES) $(test_treegc_SOURCES) $(test_xpath_SOURCES) $(test_importnode_SOURCES) $(bench_SOURCES) OBJECTS = $(test_document_OBJECTS) $(test_node_OBJECTS) $(test_cdata_OBJECTS) $(test_dtd_OBJECTS) $(test_element_OBJECTS) $(test_nodelist_OBJECTS) $(test_namednodemap_OBJECTS) $(examplea_OBJECTS) $(exampleb_OBJECTS) $(examplec_OBJECTS) $(test_mevents_OBJECTS) $(test_loadsave_OBJECTS) $(test_str_OBJECTS) $(test_treegc_OBJECTS) $(test_xpath_OBJECTS) $(test_importnode_OBJECTS) $(bench_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps test/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-noinstPROGRAMS: clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: .c.o: $(COMPILE) -c $< # FIXME: We should only use cygpath when building on Windows, # and only if it is available. .c.obj: $(COMPILE) -c `cygpath -w $<` .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core -rm -f *.$(OBJEXT) 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: test-document$(EXEEXT): $(test_document_OBJECTS) $(test_document_DEPENDENCIES) @rm -f test-document$(EXEEXT) $(LINK) $(test_document_LDFLAGS) $(test_document_OBJECTS) $(test_document_LDADD) $(LIBS) test-node$(EXEEXT): $(test_node_OBJECTS) $(test_node_DEPENDENCIES) @rm -f test-node$(EXEEXT) $(LINK) $(test_node_LDFLAGS) $(test_node_OBJECTS) $(test_node_LDADD) $(LIBS) test-cdata$(EXEEXT): $(test_cdata_OBJECTS) $(test_cdata_DEPENDENCIES) @rm -f test-cdata$(EXEEXT) $(LINK) $(test_cdata_LDFLAGS) $(test_cdata_OBJECTS) $(test_cdata_LDADD) $(LIBS) test-dtd$(EXEEXT): $(test_dtd_OBJECTS) $(test_dtd_DEPENDENCIES) @rm -f test-dtd$(EXEEXT) $(LINK) $(test_dtd_LDFLAGS) $(test_dtd_OBJECTS) $(test_dtd_LDADD) $(LIBS) test-element$(EXEEXT): $(test_element_OBJECTS) $(test_element_DEPENDENCIES) @rm -f test-element$(EXEEXT) $(LINK) $(test_element_LDFLAGS) $(test_element_OBJECTS) $(test_element_LDADD) $(LIBS) test-nodelist$(EXEEXT): $(test_nodelist_OBJECTS) $(test_nodelist_DEPENDENCIES) @rm -f test-nodelist$(EXEEXT) $(LINK) $(test_nodelist_LDFLAGS) $(test_nodelist_OBJECTS) $(test_nodelist_LDADD) $(LIBS) test-namednodemap$(EXEEXT): $(test_namednodemap_OBJECTS) $(test_namednodemap_DEPENDENCIES) @rm -f test-namednodemap$(EXEEXT) $(LINK) $(test_namednodemap_LDFLAGS) $(test_namednodemap_OBJECTS) $(test_namednodemap_LDADD) $(LIBS) examplea$(EXEEXT): $(examplea_OBJECTS) $(examplea_DEPENDENCIES) @rm -f examplea$(EXEEXT) $(LINK) $(examplea_LDFLAGS) $(examplea_OBJECTS) $(examplea_LDADD) $(LIBS) exampleb$(EXEEXT): $(exampleb_OBJECTS) $(exampleb_DEPENDENCIES) @rm -f exampleb$(EXEEXT) $(LINK) $(exampleb_LDFLAGS) $(exampleb_OBJECTS) $(exampleb_LDADD) $(LIBS) examplec$(EXEEXT): $(examplec_OBJECTS) $(examplec_DEPENDENCIES) @rm -f examplec$(EXEEXT) $(LINK) $(examplec_LDFLAGS) $(examplec_OBJECTS) $(examplec_LDADD) $(LIBS) test-mevents$(EXEEXT): $(test_mevents_OBJECTS) $(test_mevents_DEPENDENCIES) @rm -f test-mevents$(EXEEXT) $(LINK) $(test_mevents_LDFLAGS) $(test_mevents_OBJECTS) $(test_mevents_LDADD) $(LIBS) test-loadsave$(EXEEXT): $(test_loadsave_OBJECTS) $(test_loadsave_DEPENDENCIES) @rm -f test-loadsave$(EXEEXT) $(LINK) $(test_loadsave_LDFLAGS) $(test_loadsave_OBJECTS) $(test_loadsave_LDADD) $(LIBS) test-str$(EXEEXT): $(test_str_OBJECTS) $(test_str_DEPENDENCIES) @rm -f test-str$(EXEEXT) $(LINK) $(test_str_LDFLAGS) $(test_str_OBJECTS) $(test_str_LDADD) $(LIBS) test-treegc$(EXEEXT): $(test_treegc_OBJECTS) $(test_treegc_DEPENDENCIES) @rm -f test-treegc$(EXEEXT) $(LINK) $(test_treegc_LDFLAGS) $(test_treegc_OBJECTS) $(test_treegc_LDADD) $(LIBS) test-xpath$(EXEEXT): $(test_xpath_OBJECTS) $(test_xpath_DEPENDENCIES) @rm -f test-xpath$(EXEEXT) $(LINK) $(test_xpath_LDFLAGS) $(test_xpath_OBJECTS) $(test_xpath_LDADD) $(LIBS) test-importnode$(EXEEXT): $(test_importnode_OBJECTS) $(test_importnode_DEPENDENCIES) @rm -f test-importnode$(EXEEXT) $(LINK) $(test_importnode_LDFLAGS) $(test_importnode_OBJECTS) $(test_importnode_LDADD) $(LIBS) bench$(EXEEXT): $(bench_OBJECTS) $(bench_DEPENDENCIES) @rm -f bench$(EXEEXT) $(LINK) $(bench_LDFLAGS) $(bench_OBJECTS) $(bench_LDADD) $(LIBS) # 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 = test 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 check-TESTS: $(TESTS) @failed=0; all=0; \ srcdir=$(srcdir); export srcdir; \ for tst in $(TESTS); do \ if test -f $$tst; then dir=.; \ else dir="$(srcdir)"; fi; \ if $(TESTS_ENVIRONMENT) $$dir/$$tst; then \ all=`expr $$all + 1`; \ echo "PASS: $$tst"; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ failed=`expr $$failed + 1`; \ echo "FAIL: $$tst"; \ fi; \ done; \ if test "$$failed" -eq 0; then \ banner="All $$all tests passed"; \ else \ banner="$$failed of $$all tests failed"; \ fi; \ dashes=`echo "$$banner" | sed s/./=/g`; \ echo "$$dashes"; \ echo "$$banner"; \ echo "$$dashes"; \ test "$$failed" -eq 0 info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-recursive installcheck-am: installcheck: installcheck-recursive install-exec-am: install-exec: install-exec-recursive install-data-am: install-data: install-data-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-recursive uninstall-am: uninstall: uninstall-recursive all-am: Makefile $(PROGRAMS) all-redirect: all-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: 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-noinstPROGRAMS mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-noinstPROGRAMS clean-compile clean-libtool clean-tags \ clean-generic mostlyclean-am clean: clean-recursive distclean-am: distclean-noinstPROGRAMS distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-recursive maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ 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-recursive .PHONY: mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \ clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile mostlyclean-libtool distclean-libtool \ clean-libtool maintainer-clean-libtool 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 check-TESTS \ 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: gdome2-0.8.1/test/Makefile.am0000664000076400007640000000724707475017721011427 NULL = SUBDIRS = \ apigen \ $(NULL) INCLUDES = \ -DLOCALDIR=\""$(srcdir)"\" \ -I$(srcdir) \ -I$(top_srcdir)/libgdome \ -I$(top_srcdir)/libgdome/gdomecore \ $(LIBXML_CFLAGS) $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) noinst_PROGRAMS = \ test-document \ test-node \ test-cdata \ test-dtd \ test-element \ test-nodelist \ test-namednodemap \ examplea \ exampleb \ examplec \ test-mevents \ test-loadsave \ test-str \ test-treegc \ test-xpath \ test-importnode \ bench \ $(NULL) DEPS = $(top_builddir)/libgdome/libgdome.la LDADDS = $(top_builddir)/libgdome/libgdome.la $(LIBXML_LIBS) $(GLIB_LIBS) test_document_SOURCES = test-document.c test_document_LDFLAGS = test_document_DEPENDENCIES = $(DEPS) test_document_LDADD = $(LDADDS) test_node_SOURCES = test-node.c test_node_LDFLAGS = test_node_DEPENDENCIES = $(DEPS) test_node_LDADD = $(LDADDS) test_cdata_SOURCES = test-cdata.c test_cdata_LDFLAGS = test_cdata_DEPENDENCIES = $(DEPS) test_cdata_LDADD = $(LDADDS) test_dtd_SOURCES = test-dtd.c test_dtd_LDFLAGS = test_dtd_DEPENDENCIES = $(DEPS) test_dtd_LDADD = $(LDADDS) test_element_SOURCES = test-element.c test_element_LDFLAGS = test_element_DEPENDENCIES = $(DEPS) test_element_LDADD = $(LDADDS) test_nodelist_SOURCES = test-nodelist.c test_nodelist_LDFLAGS = test_nodelist_DEPENDENCIES = $(DEPS) test_nodelist_LDADD = $(LDADDS) test_namednodemap_SOURCES = test-namednodemap.c test_namednodemap_LDFLAGS = test_namednodemap_DEPENDENCIES = $(DEPS) test_namednodemap_LDADD = $(LDADDS) examplea_SOURCES = examplea.c examplea_LDFLAGS = examplea_DEPENDENCIES = $(DEPS) examplea_LDADD = $(LDADDS) exampleb_SOURCES = exampleb.c exampleb_LDFLAGS = exampleb_DEPENDENCIES = $(DEPS) exampleb_LDADD = $(LDADDS) examplec_SOURCES = examplec.c examplec_LDFLAGS = examplec_DEPENDENCIES = $(DEPS) examplec_LDADD = $(LDADDS) test_mevents_SOURCES = test-mevents.c test_mevents_LDFLAGS = test_mevents_DEPENDENCIES = $(DEPS) test_mevents_LDADD = $(LDADDS) test_loadsave_SOURCES = test-loadsave.c test_loadsave_LDFLAGS = test_loadsave_DEPENDENCIES = $(DEPS) test_loadsave_LDADD = $(LDADDS) test_str_SOURCES = test-str.c test_str_LDFLAGS = test_str_DEPENDENCIES = $(DEPS) test_str_LDADD = $(LDADDS) test_treegc_SOURCES = test-treegc.c test_treegc_LDFLAGS = test_treegc_DEPENDENCIES = $(DEPS) test_treegc_LDADD = $(LDADDS) test_xpath_SOURCES = test-xpath.c test_xpath_LDFLAGS = test_xpath_DEPENDENCIES = $(DEPS) test_xpath_LDADD = $(LDADDS) test_importnode_SOURCES = test-importnode.c test_importnode_LDFLAGS = test_importnode_DEPENDENCIES = $(DEPS) test_importnode_LDADD = $(LDADDS) bench_SOURCES = bench.c bench_LDFLAGS = bench_DEPENDENCIES = $(DEPS) bench_LDADD = $(LDADDS) EXTRA_DIST = \ exampleb.xml \ examplec.xml \ test-document2.xml \ test-document3.xml \ test-dtd.xml \ test-dtd.dtd \ test-element.xml \ test-node.xml \ test-nodelist.xml \ test-namednodemap.xml \ test-mevents.xml \ test-loadsave1.xml \ test-loadsave2.xml \ test.xml \ test-treegc.xml \ test-xpath.xml \ $(NULL) TESTS_ENVIROMENT = \ LD_LIBRARY_PATH=$(top_builddir)/libgdome/ \ $(NULL) TESTS = \ test-document \ test-node \ test-cdata \ test-dtd \ test-element \ test-nodelist \ test-namednodemap \ examplea \ exampleb \ examplec \ test-mevents \ test-loadsave \ test-str \ test-treegc \ test-xpath \ test-importnode \ $(NULL) gdome2-0.8.1/test/test-document.c0000664000076400007640000004203407704517021012314 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* test-document.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include void dot() { printf("."); fflush(stdout); } gboolean test_document1 (GdomeDocument *doc) { GdomeElement *root, *el1, *el2; GdomeDocumentFragment *df; GdomeText *txt; GdomeCDATASection *cds; GdomeComment *cmt; GdomeProcessingInstruction *pi; GdomeAttr *attr1, *attr2; GdomeException exc = 0; GdomeDOMString *tstr1, *tstr2; GdomeDocument *tdoc; GdomeNode *ntmp; gboolean ret = TRUE; /* Test Documet.documentElement */ root = gdome_doc_documentElement (doc, &exc); if (root == NULL) fprintf (stderr, "\nDocument.documentElement, NULL"), ret = FALSE; else { tstr1 = gdome_el_tagName (root, &exc); if (strcmp(tstr1->str, "TEST")) fprintf (stderr, "\nDocument.documentElement, wrong"), ret = FALSE; gdome_str_unref (tstr1); /*gdome_el_unref (root);*/ } dot(); /* Test Document.createElement */ tstr1 = gdome_str_mkref ("EL1"); el1 = gdome_doc_createElement (doc, tstr1, &exc); gdome_str_unref (tstr1); el1 = GDOME_EL(el1); if (el1 == NULL) fprintf (stderr, "\nDocument.createElement, NULL"), ret = FALSE; else if (gdome_el_nodeType (el1, &exc) != GDOME_ELEMENT_NODE) fprintf (stderr, "\nDocument.createElement, wrong nodeType"), ret = FALSE; else { tdoc = gdome_el_ownerDocument (el1, &exc); if (tdoc != doc) fprintf (stderr, "\nDocument.createElement, wrong ownerDocument"), ret = FALSE; else { gdome_doc_unref (tdoc, &exc); tstr1 = gdome_el_tagName (el1, &exc); if (strcmp(tstr1->str, "EL1")) fprintf (stderr, "\nDocument.createElement, wrong tagName"), ret = FALSE; gdome_str_unref(tstr1); } } dot(); /* Test Document.createElementNS */ tstr1 = gdome_str_mkref ("tns:EL2"); tstr2 = gdome_str_mkref ("urn:test.tst"); el2 = gdome_doc_createElementNS (doc, tstr2, tstr1, &exc); gdome_str_unref (tstr1); gdome_str_unref (tstr2); if (el2 == NULL) fprintf (stderr, "\nDocument.createElementNS, NULL"), ret = FALSE; else if (gdome_el_nodeType (el2, &exc) != GDOME_ELEMENT_NODE) fprintf (stderr, "\nDocument.createElement, wrong nodeType"), ret = FALSE; else { tdoc = gdome_el_ownerDocument (el2, &exc); if (tdoc != doc) fprintf (stderr, "\nDocument.createElementNS, wrong ownerElement"), ret = FALSE; else { gdome_doc_unref (tdoc, &exc); tstr1 = gdome_el_tagName (el2, &exc); if (strcmp(tstr1->str, "tns:EL2")) fprintf (stderr, "\nDocument.createElement, wrong tagName"), ret = FALSE; gdome_str_unref (tstr1); tstr1 = gdome_el_localName (el2, &exc); if (strcmp(tstr1->str, "EL2")) fprintf (stderr, "\nDocument.createElement, wrong localName"), ret = FALSE; gdome_str_unref (tstr1); tstr1 = gdome_el_namespaceURI (el2, &exc); if (strcmp(tstr1->str, "urn:test.tst")) fprintf (stderr, "\nDocument.createElement, wrong namespaceURI"), ret = FALSE; gdome_str_unref(tstr1); } } dot(); /* Test Document.createDocumentFragment */ df = gdome_doc_createDocumentFragment (doc, &exc); df = GDOME_DF(df); if (df == NULL) fprintf (stderr, "\nDocument.createDocumentFragment, NULL"), ret = FALSE; else if (gdome_df_nodeType (df, &exc) != GDOME_DOCUMENT_FRAGMENT_NODE) fprintf (stderr, "\nDocument.createDocumentFragment, wrong nodeType"), ret = FALSE; else { tdoc = gdome_df_ownerDocument (df, &exc); if (tdoc != doc) fprintf (stderr, "\nDocument.createDocumentFragment, wrong ownerDocument"), ret = FALSE; else { gdome_doc_unref (tdoc, &exc); tstr1 = gdome_df_nodeName (df, &exc); if (strcmp(tstr1->str, "#document-fragment")) fprintf (stderr, "\nDocument.createDocumentFragment, wrong nodeName"), ret = FALSE; gdome_str_unref (tstr1); } } gdome_df_unref (df, &exc); dot(); /* Test Document.createTextNode */ tstr1 = gdome_str_mkref ("Text Test"); txt = gdome_doc_createTextNode (doc, tstr1, &exc); gdome_str_unref (tstr1); /* txt = GDOME_T(txt);*/ if (txt == NULL) fprintf (stderr, "\nDocument.createTextNode, NULL"), ret = FALSE; else if (gdome_t_nodeType (txt, &exc) != GDOME_TEXT_NODE) fprintf (stderr, "\nDocument.createTextNode, wrong nodeType"), ret = FALSE; else { tdoc = gdome_t_ownerDocument (txt, &exc); if (tdoc != doc) fprintf (stderr, "\nDocument.createTextNode, wrong ownerDocument"), ret = FALSE; else { gdome_doc_unref (tdoc, &exc); tstr1 = gdome_t_nodeName (txt, &exc); if (strcmp(tstr1->str, "#text")) fprintf (stderr, "\nDocument.createTextNode, wrong nodeName"), ret = FALSE; gdome_str_unref (tstr1); tstr1 = gdome_t_nodeValue (txt, &exc); if (strcmp(tstr1->str, "Text Test")) fprintf (stderr, "\nDocument.createTextNode, wrong nodeValue"), ret = FALSE; gdome_str_unref(tstr1); } } dot(); /* Test Document.createCDATASection */ tstr1 = gdome_str_mkref ("Text Test"); cds = gdome_doc_createCDATASection (doc, tstr1, &exc); gdome_str_unref (tstr1); cds = GDOME_CDS(cds); if (cds == NULL) fprintf (stderr, "\nDocument.createCDATASection, NULL"), ret = FALSE; else if (gdome_cds_nodeType (cds, &exc) != GDOME_CDATA_SECTION_NODE) fprintf (stderr, "\nDocument.createCDATASection, wrong nodeType"), ret = FALSE; else { tdoc = gdome_cds_ownerDocument (cds, &exc); if (tdoc != doc) fprintf (stderr, "\nDocument.createCDATASection, wrong ownerDocument"), ret = FALSE; else { gdome_doc_unref (tdoc, &exc); tstr1 = gdome_cds_nodeName (cds, &exc); if (strcmp(tstr1->str, "#cdata-section")) fprintf (stderr, "\nDocument.createCDATASection, wrong nodeName"), ret = FALSE; gdome_str_unref (tstr1); tstr1 = gdome_cds_nodeValue (cds, &exc); if (strcmp(tstr1->str, "Text Test")) fprintf (stderr, "\nDocument.createCDATASection, wrong nodeValue"), ret = FALSE; gdome_str_unref(tstr1); } } dot(); /* Test Document.createComment */ tstr1 = gdome_str_mkref ("dududu dadada"); cmt = gdome_doc_createComment (doc, tstr1, &exc); gdome_str_unref (tstr1); cmt = GDOME_C(cmt); if (cmt == NULL) fprintf (stderr, "\nDocument.createComment, NULL"), ret = FALSE; else if (gdome_c_nodeType (cmt, &exc) != GDOME_COMMENT_NODE) fprintf (stderr, "\nDocument.createComment, wrong nodeType"), ret = FALSE; else { tdoc = gdome_c_ownerDocument (cmt, &exc); if (tdoc != doc) fprintf (stderr, "\nDocument.createComment, wrong ownerDocument"), ret = FALSE; else { gdome_doc_unref (tdoc, &exc); tstr1 = gdome_c_nodeName (cmt, &exc); if (strcmp(tstr1->str, "#comment")) fprintf (stderr, "\nDocument.createComment, wrong nodeName"), ret = FALSE; gdome_str_unref (tstr1); tstr1 = gdome_c_nodeValue (cmt, &exc); if (strcmp(tstr1->str, "dududu dadada")) fprintf (stderr, "\nDocument.createComment, wrong nodeValue"), ret = FALSE; gdome_str_unref(tstr1); } } dot(); /* Test Document.createProcessingInstruction */ tstr1 = gdome_str_mkref ("sqlprocessor"); tstr2 = gdome_str_mkref ("SELECT * FROM blah"); pi = gdome_doc_createProcessingInstruction (doc, tstr1, tstr2, &exc); gdome_str_unref (tstr1); gdome_str_unref (tstr2); pi = GDOME_PI(pi); if (pi == NULL) fprintf (stderr, "\nDocument.createProcessingInstruction, NULL"), ret = FALSE; else if (gdome_pi_nodeType (pi, &exc) != GDOME_PROCESSING_INSTRUCTION_NODE) fprintf (stderr, "\nDocument.createProcessingInstruction, wrong nodeType"), ret = FALSE; else { tdoc = gdome_pi_ownerDocument (pi, &exc); if (tdoc != doc) fprintf (stderr, "\nDocument.createProcessingInstruction, wrong ownerDocument"), ret = FALSE; else { gdome_doc_unref (tdoc, &exc); tstr1 = gdome_pi_nodeName (pi, &exc); if (strcmp(tstr1->str, "sqlprocessor")) fprintf (stderr, "\nDocument.createProcessingInstruction, wrong nodeName"), ret = FALSE; gdome_str_unref (tstr1); tstr1 = gdome_pi_nodeValue (pi, &exc); if (strcmp(tstr1->str, "SELECT * FROM blah")) fprintf (stderr, "\nDocument.createProcessingInstruction, wrong nodeValue"), ret = FALSE; gdome_str_unref(tstr1); } } dot(); /* Test Document.createAttribute */ tstr1 = gdome_str_mkref ("ATTR1"); attr1 = gdome_doc_createAttribute (doc, tstr1, &exc); gdome_str_unref(tstr1); attr1 = GDOME_A(attr1); if (attr1 == NULL) fprintf (stderr, "\nDocument.createAttribute, NULL"), ret = FALSE; else if (gdome_a_nodeType (attr1, &exc) != GDOME_ATTRIBUTE_NODE) fprintf (stderr, "\nDocument.createAttribute, wrong nodeType"), ret = FALSE; else { tdoc = gdome_a_ownerDocument (attr1, &exc); if (tdoc != doc) fprintf (stderr, "\nDocument.createAttribute, wrong ownerDocument"), ret = FALSE; else { gdome_doc_unref (tdoc, &exc); tstr1 = gdome_a_name (attr1, &exc); if (strcmp(tstr1->str, "ATTR1")) fprintf (stderr, "\nDocument.createAttribute, wrong name"), ret = FALSE; gdome_str_unref (tstr1); tstr1 = gdome_a_value (attr1, &exc); if (strcmp(tstr1->str, "")) fprintf (stderr, "\nDocument.createAttribute, wrong value"), ret = FALSE; gdome_str_unref(tstr1); } } dot(); /* Test Document.createAttributeNS */ tstr1 = gdome_str_mkref ("tns:ATTR2"); tstr2 = gdome_str_mkref ("urn:test.tst"); attr2 = gdome_doc_createAttributeNS (doc, tstr2, tstr1, &exc); gdome_str_unref (tstr1); gdome_str_unref (tstr2); if (attr1 == NULL) fprintf (stderr, "\nDocument.createAttributeNS, NULL"), ret = FALSE; else if (gdome_a_nodeType (attr2, &exc) != GDOME_ATTRIBUTE_NODE) fprintf (stderr, "\nDocument.createAttributeNS, wrong nodeType"), ret = FALSE; else { tdoc = gdome_a_ownerDocument (attr2, &exc); if (tdoc != doc) fprintf (stderr, "\nDocument.createAttributeNS, wrong ownerDocument"), ret = FALSE; else { gdome_doc_unref (tdoc, &exc); tstr1 = gdome_a_name (attr2, &exc); if (strcmp(tstr1->str, "tns:ATTR2")) fprintf (stderr, "\nDocument.createAttributeNS, wrong name"), ret = FALSE; gdome_str_unref (tstr1); tstr1 = gdome_a_localName (attr2, &exc); if (strcmp(tstr1->str, "ATTR2")) fprintf (stderr, "\nDocument.createAttributeNS, wrong localName"), ret = FALSE; gdome_str_unref (tstr1); tstr1 = gdome_a_namespaceURI (attr2, &exc); if (strcmp(tstr1->str, "urn:test.tst")) fprintf (stderr, "\nDocument.createAttributeNS, wrong namespaceURI"), ret = FALSE; gdome_str_unref (tstr1); tstr1 = gdome_a_value (attr2, &exc); if (strcmp(tstr1->str, "")) fprintf (stderr, "\nDocument.createAttributeNS, wrong value"), ret = FALSE; gdome_str_unref(tstr1); } } dot(); /* Now I build a simple tree with the nodes created */ ntmp = (GdomeNode *)gdome_el_setAttributeNode (root, attr1, &exc); gdome_n_unref (ntmp, &exc); gdome_a_unref (attr1, &exc); ntmp = (GdomeNode *)gdome_el_setAttributeNode (el1, attr2, &exc); gdome_n_unref (ntmp, &exc); gdome_a_unref (attr2, &exc); ntmp = (GdomeNode *)gdome_el_appendChild (root,GDOME_N(el1), &exc); gdome_n_unref (ntmp, &exc); gdome_el_unref (el1, &exc); ntmp = (GdomeNode *)gdome_el_appendChild (root,GDOME_N(pi), &exc); gdome_n_unref (ntmp, &exc); gdome_pi_unref (pi, &exc); ntmp = (GdomeNode *)gdome_el_appendChild (el2,GDOME_N(txt), &exc); gdome_n_unref (ntmp, &exc); gdome_t_unref (txt, &exc); ntmp = (GdomeNode *)gdome_el_appendChild (el2,GDOME_N(cds), &exc); gdome_n_unref (ntmp, &exc); gdome_cds_unref (cds, &exc); ntmp = (GdomeNode *)gdome_el_appendChild (el2,GDOME_N(cmt), &exc); gdome_n_unref (ntmp, &exc); gdome_c_unref (cmt, &exc); ntmp = (GdomeNode *)gdome_el_appendChild (root,GDOME_N(el2), &exc); gdome_n_unref (ntmp, &exc); gdome_el_unref (el2, &exc); gdome_el_unref (root, &exc); dot(); printf ("test_document1\n"); return ret; } gboolean test_document2 (GdomeDocument *doc) { GdomeElement *els[9], *root; GdomeNode *tel; GdomeNodeList *nl; GdomeException exc = 0; GdomeDOMString *tstr1; gboolean ret = TRUE; int i; /* Test Document.getElementById*/ for(i=0; i<9; i++) { tstr1 = gdome_str_mkref_own(g_strdup_printf("%d",i)); els[i] = gdome_doc_getElementById(doc, tstr1, &exc); if(els[i] == NULL) fprintf (stderr, "\nDocument.getElementById(\"%s\"), NULL",tstr1->str), ret = FALSE; gdome_str_unref(tstr1); } dot(); /* Test Document.getElementByTagName */ tstr1 = gdome_str_mkref("NODE"); nl = gdome_doc_getElementsByTagName(doc, tstr1, &exc); if(nl == NULL) fprintf (stderr, "\nDocument.getElementByTagName(\"%s\"), NULL",tstr1->str), ret = FALSE; if(gdome_nl_length(nl, &exc) != 9) fprintf (stderr, "\nDocument.getElementByTagName(\"%s\"), wrong length",tstr1->str), ret = FALSE; for(i=0; i<9; i++) { tel = gdome_nl_item(nl, (unsigned long)i, &exc); if (tel != (GdomeNode *)els[i]) fprintf (stderr, "\nDocument.getElementByTagName(\"%s\"), wrong %d-th item",tstr1->str,i), ret = FALSE; if (tel != NULL) gdome_n_unref (tel, &exc); } gdome_str_unref(tstr1); dot(); /* Is NodeList live? */ root = gdome_doc_documentElement (doc, &exc); tel = gdome_el_removeChild (root, (GdomeNode *)els[3], &exc); gdome_el_unref (els[5], &exc); gdome_el_unref (els[4], &exc); gdome_el_unref (els[3], &exc); gdome_n_unref (tel, &exc); gdome_el_unref (root, &exc); tel = gdome_nl_item(nl, 3L, &exc); if(tel != (GdomeNode *)els[6]) fprintf (stderr, "\nNODELIST IS NOT LIVE!!"), ret = FALSE; gdome_n_unref (tel, &exc); gdome_nl_unref (nl, &exc); dot(); gdome_el_unref (els[0], &exc); gdome_el_unref (els[1], &exc); gdome_el_unref (els[2], &exc); gdome_el_unref (els[6], &exc); gdome_el_unref (els[7], &exc); gdome_el_unref (els[8], &exc); printf ("test_document2\n"); return ret; } gboolean test_document3 (GdomeDocument *doc) { GdomeElement *els[4], *root; GdomeNode *tel; GdomeNodeList *nl; GdomeException exc = 0; GdomeDOMString *tstr1, *tstr2; gboolean ret = TRUE; int i; /* Test Document.getElementById*/ for(i=1; i<9; i+=2) { tstr1 = gdome_str_mkref_own(g_strdup_printf("%d",i)); els[i/2] = gdome_doc_getElementById(doc, tstr1, &exc); if(els[i/2] == NULL) fprintf (stderr, "\nDocument.getElementById(\"%s\"), NULL",tstr1->str), ret = FALSE; gdome_str_unref(tstr1); } dot(); /* Test Document.getElementByTagNameNS */ tstr1 = gdome_str_mkref("NODE"); tstr2 = gdome_str_mkref("urn:test.tst"); nl = gdome_doc_getElementsByTagNameNS(doc, tstr2, tstr1, &exc); if(nl == NULL) fprintf (stderr, "\nDocument.getElementByTagNameNS(\"%s\",\"%s\"), NULL",tstr2->str,tstr1->str), ret = FALSE; if(gdome_nl_length(nl, &exc) != 4) fprintf (stderr, "\nDocument.getElementByTagNameNS(\"%s\",\"%s\"), wrong length",tstr2->str,tstr1->str), ret = FALSE; for(i=0; i<4; i++) { tel = gdome_nl_item(nl, (unsigned long)i, &exc); if (tel != (GdomeNode *)els[i]) fprintf (stderr, "\nDocument.getElementByTagName(\"%s\",\"%s\"), wrong %d-th item",tstr2->str,tstr1->str,i), ret = FALSE; if (tel != NULL) gdome_n_unref (tel, &exc); } gdome_str_unref(tstr1); gdome_str_unref(tstr2); dot(); /* Is NodeList live? */ root = gdome_doc_documentElement (doc, &exc); tel = gdome_el_removeChild (root, (GdomeNode *)els[1], &exc); gdome_el_unref (els[2], &exc); gdome_el_unref (els[1], &exc); gdome_n_unref (tel, &exc); gdome_el_unref (root, &exc); tel = gdome_nl_item(nl, 1L, &exc); if(tel != (GdomeNode *)els[3]) fprintf (stderr, "\nNODELIST IS NOT LIVE!!"), ret = FALSE; gdome_n_unref (tel, &exc); gdome_nl_unref (nl, &exc); dot(); gdome_el_unref (els[0], &exc); gdome_el_unref (els[3], &exc); printf ("test_document3\n"); return ret; } int main (int argc, char **argv) { GdomeDOMImplementation *domImpl = NULL; GdomeDocument *domdoc = NULL; GdomeDOMString *str = NULL; GdomeException exc = 0; gboolean ret; domImpl = gdome_di_mkref(); str = gdome_str_mkref ("TEST"); domdoc = gdome_di_createDocument (domImpl, NULL, str, NULL, &exc); gdome_str_unref (str); ret = test_document1(domdoc); gdome_di_saveDocToFile(domImpl, domdoc, LOCALDIR"/test-document1.xml", GDOME_SAVE_STANDARD, &exc); gdome_doc_unref(domdoc, &exc); domdoc = gdome_di_createDocFromURI(domImpl, LOCALDIR"/test-document2.xml", GDOME_LOAD_PARSING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOImplementation.createDocFromURI: failed\n test-document2.xml not found\n"); return -1; } ret = test_document2(domdoc); gdome_doc_unref (domdoc, &exc); domdoc = gdome_di_createDocFromURI(domImpl, LOCALDIR"/test-document3.xml", GDOME_LOAD_PARSING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOImplementation.createDocFromURI: failed\n test-document3.xml not found\n"); return -1; } ret = test_document3(domdoc); gdome_doc_unref (domdoc, &exc); if(ret) return 0; else return -1; } gdome2-0.8.1/test/test-node.c0000664000076400007640000003355607403635046011440 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* test-node.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include void dot() { printf("."); fflush(stdout); } gboolean test_node(GdomeNode *el) { GdomeNode *node1, *node2, *node3, *node4, *node5; GdomeNode *tnode, *cnode, *ttnode; GdomeNodeList *nl; GdomeNamedNodeMap *nnm; GdomeException exc; GdomeDOMString *str; gboolean ret = TRUE; int i; nl = gdome_n_childNodes(el, &exc); node1 = gdome_nl_item(nl, 1L, &exc); node2 = gdome_nl_item(nl, 3L, &exc); node3 = gdome_nl_item(nl, 5L, &exc); node4 = gdome_nl_item(nl, 7L, &exc); node5 = gdome_nl_item(nl, 9L, &exc); /*------------------- TEST ATTRIBUTES ------------------*/ /* Test Node.attributes */ nnm = gdome_n_attributes(node3, &exc); if (nnm == NULL) fprintf(stderr,"\nNode.attributes, NULL"), ret = FALSE; else if(gdome_nnm_length(nnm, &exc) != 2) fprintf(stderr,"\nNode.attributes, wrong length"), ret = FALSE; dot(); /* Test Node.firstChild */ tnode = gdome_n_firstChild(el, &exc); ttnode = gdome_nl_item(nl, 0L, &exc); if (tnode != ttnode) fprintf(stderr,"\nNode.firstChild, error"), ret = FALSE; gdome_n_unref (tnode, &exc); gdome_n_unref (ttnode, &exc); dot(); /* Test Node.lastChild */ tnode = gdome_n_lastChild(el, &exc); ttnode = gdome_nl_item(nl, gdome_nl_length(nl, &exc) - 1, &exc); if (tnode != ttnode) fprintf(stderr,"\nNode.lastChild, error"), ret = FALSE; gdome_n_unref (tnode, &exc); gdome_n_unref (ttnode, &exc); dot(); /* Test Node.localName */ str = gdome_n_localName(node2, &exc); if(strcmp(str->str,"NODE2")) fprintf(stderr,"\nNode.localName, wrong on NODE2"), ret = FALSE; gdome_str_unref(str); str = gdome_n_localName(node3, &exc); if(str != NULL) fprintf(stderr,"\nNode.localName, wrong on NODE3"), ret = FALSE; dot(); /* Test Node.namespaceURI */ str = gdome_n_namespaceURI(node2, &exc); if(strcmp(str->str,"urn:test.tst")) fprintf(stderr,"\nNode.namespaceURI, wrong on NODE2"), ret = FALSE; gdome_str_unref(str); str = gdome_n_namespaceURI(node3, &exc); if(str != NULL) fprintf(stderr,"\nNode.namespaceURI, wrong on NODE3"), ret = FALSE; dot(); /* Test Node.nextSibling */ tnode = gdome_n_nextSibling(node2, &exc); ttnode = gdome_nl_item(nl, 4L, &exc); if (tnode != ttnode) fprintf(stderr,"\nNode.nextSibling, error"), ret = FALSE; gdome_n_unref (tnode, &exc); gdome_n_unref (ttnode, &exc); dot(); /* Test Node.nodeName */ str = gdome_n_nodeName(node1, &exc); if(strcmp(str->str,"NODE1")) fprintf(stderr,"\nNode.nodeName, wrong on NODE1"), ret = FALSE; gdome_str_unref(str); str = gdome_n_nodeName(node2, &exc); if(strcmp(str->str,"tns:NODE2")) fprintf(stderr,"\nNode.nodeName, wrong on NODE2"), ret = FALSE; gdome_str_unref(str); tnode = gdome_n_firstChild(node1, &exc); str = gdome_n_nodeName(tnode, &exc); if(strcmp(str->str,"#text")) fprintf(stderr,"\nNode.nodeName, wrong on TNODE"), ret = FALSE; gdome_str_unref(str); gdome_n_unref(tnode, &exc); dot(); /* Test Node.nodeType */ if (gdome_n_nodeType(node2, &exc) != GDOME_ELEMENT_NODE) fprintf(stderr,"\nNode.nextType, error"), ret = FALSE; dot(); /* Test Node.nodeValue */ tnode = gdome_n_firstChild(node2, &exc); str = gdome_n_nodeValue(tnode, &exc); if(strcmp(str->str,"This is a node with a namespace")) fprintf(stderr,"\nNode.nodeValue, wrong on TNODE"), ret = FALSE; gdome_str_unref(str); gdome_n_unref(tnode, &exc); dot(); /* Test Node.ownerDocument */ tnode = (GdomeNode *)gdome_n_ownerDocument(node2, &exc); ttnode = (GdomeNode *)gdome_n_ownerDocument(node3, &exc); if (tnode != ttnode) fprintf(stderr,"\nNode.ownerDocument, error"), ret = FALSE; gdome_n_unref (tnode, &exc); gdome_n_unref (ttnode, &exc); dot(); /* Test Node.parentNode */ tnode = (GdomeNode *)gdome_n_parentNode(node2, &exc); if (tnode != el) fprintf(stderr,"\nNode.parentNode, error"), ret = FALSE; gdome_n_unref (tnode, &exc); dot(); /* Test Node.prefix */ str = gdome_n_prefix(node2, &exc); if(strcmp(str->str,"tns")) fprintf(stderr,"\nNode.prefix, wrong on NODE2"), ret = FALSE; gdome_str_unref(str); str = gdome_n_prefix(node3, &exc); if(str != NULL) fprintf(stderr,"\nNode.prefix, wrong on NODE3"), ret = FALSE; dot(); /* Test Node.previousSibling */ tnode = gdome_n_previousSibling(node2, &exc); ttnode = gdome_nl_item(nl, 2L, &exc); if (tnode != ttnode) fprintf(stderr,"\nNode.previousSibling, error"), ret = FALSE; gdome_n_unref (tnode, &exc); gdome_n_unref (ttnode, &exc); dot(); /* Test Node::set_nodeValue */ tnode = gdome_n_firstChild(node2, &exc); str = gdome_str_mkref ("xxxxx"); gdome_n_set_nodeValue(tnode, str, &exc); gdome_str_unref(str); str = gdome_n_nodeValue(tnode, &exc); if(strcmp(str->str,"xxxxx")) fprintf(stderr,"\nNode.set_nodeValue, error"), ret = FALSE; gdome_str_unref(str); gdome_n_unref(tnode, &exc); str = gdome_str_mkref ("ATTR1"); tnode = gdome_nnm_getNamedItem(nnm, str, &exc); gdome_str_unref(str); str = gdome_str_mkref ("Ciao"); gdome_n_set_nodeValue(tnode, str, &exc); gdome_str_unref(str); str = gdome_n_nodeValue(tnode, &exc); if(strcmp(str->str,"Ciao")) fprintf(stderr,"\nNode.set_nodeValue, error"), ret = FALSE; gdome_str_unref(str); gdome_n_unref(tnode, &exc); gdome_nnm_unref (nnm, &exc); dot(); /* Test Node::set_prefix */ str = gdome_str_mkref ("xxx"); gdome_n_set_prefix(node2, str, &exc); gdome_str_unref(str); str = gdome_n_prefix(node2, &exc); if(strcmp(str->str,"xxx")) fprintf(stderr,"\nNode.set_prefix, error"), ret = FALSE; gdome_str_unref(str); dot(); /*------------------- TEST METHODS ------------------*/ /* Test Node::hasChildNodes */ if (!gdome_n_hasChildNodes(node1, &exc)) fprintf(stderr,"\nNode.hasChildNodes(), error on NODE1"), ret = FALSE; if (gdome_n_hasChildNodes(node4, &exc)) fprintf(stderr,"\nNode.hasChildNodes(), error on NODE4"), ret = FALSE; dot(); /* Test Node::hasAttributes */ if (!gdome_n_hasAttributes(node3, &exc)) fprintf(stderr,"\nNode.hasAttributes(), error on NODE3"), ret = FALSE; if (gdome_n_hasAttributes(node1, &exc)) fprintf(stderr,"\nNode.hasAttributes(), error on NODE1"), ret = FALSE; dot(); /* Test Methods... reverse the order of the nodes */ node1 = gdome_n_appendChild(el, node1, &exc); gdome_n_unref (node1, &exc); node5 = gdome_n_replaceChild(el, node4, node5, &exc); gdome_n_unref (node5, &exc); node2 = gdome_n_insertBefore(el, node2, node1, &exc); gdome_n_unref (node2, &exc); node3 = gdome_n_insertBefore(el, node3, node2, &exc); gdome_n_unref (node3, &exc); node4 = gdome_n_removeChild(el, node4, &exc); gdome_n_unref (node4, &exc); node4 = gdome_n_insertBefore(el, node4, node3, &exc); gdome_n_unref (node4, &exc); node5 = gdome_n_insertBefore(el, node5, node4, &exc); gdome_n_unref (node5, &exc); /* Add indentation */ tnode = gdome_nl_item(nl, 0L, &exc); cnode = gdome_n_cloneNode(tnode, 0, &exc); cnode = gdome_n_insertBefore(el, cnode, node5, &exc); gdome_n_unref (cnode, &exc); gdome_n_unref (cnode, &exc); cnode = gdome_n_cloneNode(tnode, 0, &exc); gdome_n_insertBefore(el, cnode, node4, &exc); gdome_n_unref (cnode, &exc); gdome_n_unref (cnode, &exc); cnode = gdome_n_cloneNode(tnode, 0, &exc); gdome_n_insertBefore(el, cnode, node3, &exc); gdome_n_unref (cnode, &exc); gdome_n_unref (cnode, &exc); cnode = gdome_n_cloneNode(tnode, 0, &exc); gdome_n_insertBefore(el, cnode, node2, &exc); gdome_n_unref (cnode, &exc); gdome_n_unref (cnode, &exc); cnode = gdome_n_cloneNode(tnode, 0, &exc); gdome_n_insertBefore(el, cnode, node1, &exc); gdome_n_unref (cnode, &exc); gdome_n_unref (cnode, &exc); str = gdome_str_mkref("\n"); gdome_n_set_nodeValue(tnode, str, &exc); gdome_str_unref (str); tnode = gdome_n_appendChild(el, tnode, &exc); gdome_n_unref (tnode, &exc); gdome_n_unref (tnode, &exc); /* delete old indentation */ /* if nodelist is not live this doesn't work fine */ for (i=0; i<5; i++) { tnode = gdome_nl_item(nl, 0L, &exc); gdome_n_removeChild(el, tnode, &exc); gdome_n_unref (tnode, &exc); gdome_n_unref (tnode, &exc); } gdome_nl_unref (nl, &exc); dot(); gdome_n_unref (node1, &exc); gdome_n_unref (node2, &exc); gdome_n_unref (node3, &exc); gdome_n_unref (node4, &exc); gdome_n_unref (node5, &exc); fprintf(stderr,"test_node\n"); return ret; } gboolean test_df_node(GdomeNode *el) { GdomeDocumentFragment *df; GdomeDocument *doc; GdomeElement *el1, *el2, *el3, *tel, *root; GdomeComment *cmt1, *cmt2; GdomeText *txt1, *txt2, *txt3, *txt4, *txt5, *txt6; GdomeAttr *attr1,*attr2; GdomeNodeList *nl; GdomeDOMString *str; GdomeException exc; gboolean ret = TRUE; doc = gdome_n_ownerDocument (el, &exc); df = gdome_doc_createDocumentFragment (doc, &exc); dot(); /* Creation of comment nodes */ str = gdome_str_mkref("*** Start of the new nodes ***"); cmt1 = gdome_doc_createComment(doc, str, &exc); gdome_str_unref (str); str = gdome_str_mkref("*** Stop of the new nodes ***"); cmt2 = gdome_doc_createComment(doc, str, &exc); gdome_str_unref (str); dot(); /* Creation of attribute nodes */ str = gdome_str_mkref("DTATTR1"); attr1 = gdome_doc_createAttribute(doc, str, &exc); gdome_str_unref (str); str = gdome_str_mkref("dtattr1"); gdome_a_set_value(attr1, str, &exc); gdome_str_unref (str); str = gdome_str_mkref("DTATTR2"); attr2 = gdome_doc_createAttribute(doc, str, &exc); gdome_str_unref (str); str = gdome_str_mkref("dtattr2"); gdome_a_set_value(attr2, str, &exc); gdome_str_unref (str); dot(); /* Creation of text nodes for indentation */ str = gdome_str_mkref("\n "); txt1 = gdome_doc_createTextNode(doc, str, &exc); txt2 = gdome_doc_createTextNode(doc, str, &exc); txt3 = gdome_doc_createTextNode(doc, str, &exc); txt4 = gdome_doc_createTextNode(doc, str, &exc); txt5 = gdome_doc_createTextNode(doc, str, &exc); gdome_str_unref (str); str = gdome_str_mkref("\n "); txt6 = gdome_doc_createTextNode(doc, str, &exc); gdome_str_unref (str); gdome_doc_unref (doc, &exc); dot(); /* Creation of element nodes */ str = gdome_str_mkref("DTEL1"); el1 = gdome_doc_createElement(doc, str, &exc); gdome_str_unref (str); gdome_el_setAttributeNode(el1, attr1, &exc); str = gdome_str_mkref("DTEL2"); el2 = gdome_doc_createElement(doc, str, &exc); gdome_str_unref (str); gdome_el_setAttributeNode(el2, attr2, &exc); gdome_el_appendChild(el1, (GdomeNode *)txt6, &exc); gdome_t_unref (txt6, &exc); gdome_el_appendChild(el1, (GdomeNode *)el2, &exc); gdome_el_unref (el2, &exc); gdome_el_appendChild(el1, (GdomeNode *)txt5, &exc); gdome_t_unref (txt5, &exc); str = gdome_str_mkref("DTEL3"); el3 = gdome_doc_createElement(doc, str, &exc); gdome_str_unref (str); dot(); /* Add theese Nodes to the Document Fragment */ gdome_df_appendChild(df, (GdomeNode *)cmt1, &exc); gdome_c_unref (cmt1, &exc); gdome_df_appendChild(df, (GdomeNode *)txt1, &exc); gdome_t_unref (txt1, &exc); gdome_df_appendChild(df, (GdomeNode *)el1, &exc); gdome_el_unref (el1, &exc); gdome_df_appendChild(df, (GdomeNode *)txt2, &exc); gdome_t_unref (txt2, &exc); gdome_df_appendChild(df, (GdomeNode *)el3, &exc); gdome_el_unref (el3, &exc); gdome_df_appendChild(df, (GdomeNode *)txt3, &exc); gdome_t_unref (txt3, &exc); gdome_df_appendChild(df, (GdomeNode *)cmt2, &exc); gdome_c_unref (cmt2, &exc); gdome_df_appendChild(df, (GdomeNode *)txt4, &exc); gdome_t_unref (txt4, &exc); dot(); str = gdome_str_mkref("NODE3"); nl = gdome_doc_getElementsByTagName(doc, str, &exc); gdome_str_unref (str); tel = (GdomeElement *)gdome_nl_item(nl, 0L, &exc); gdome_nl_unref (nl, &exc); root = (GdomeElement *)gdome_el_parentNode(tel, &exc); if (!gdome_el_insertBefore(root, (GdomeNode *)df, (GdomeNode *)tel, &exc)) fprintf (stderr, "\nNode.insertBefore (DocumentFragment), failed"), ret = FALSE; gdome_df_unref (df, &exc); gdome_df_unref (df, &exc); gdome_el_unref (tel, &exc); gdome_el_unref (root, &exc); dot(); gdome_c_unref (cmt1, &exc); gdome_c_unref (cmt2, &exc); gdome_a_unref (attr1, &exc); gdome_a_unref (attr2, &exc); gdome_t_unref (txt1, &exc); gdome_t_unref (txt2, &exc); gdome_t_unref (txt3, &exc); gdome_t_unref (txt4, &exc); gdome_t_unref (txt5, &exc); gdome_t_unref (txt6, &exc); gdome_el_unref (el1, &exc); gdome_el_unref (el2, &exc); gdome_el_unref (el3, &exc); fprintf(stderr,"test_df_node\n"); return ret; } int main (int argc, char **argv) { GdomeDOMImplementation *domImpl = NULL; GdomeDocument *domdoc = NULL; GdomeElement *el; GdomeException exc = 0; gboolean ret; domImpl = gdome_di_mkref(); domdoc = gdome_di_createDocFromURI(domImpl, LOCALDIR"/test-node.xml", GDOME_LOAD_PARSING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOImplementation.createDocFromURI: failed\n test-node.xml not found\n"); return -1; } el = gdome_doc_documentElement (domdoc, &exc); ret = test_node((GdomeNode *)el); ret = test_df_node((GdomeNode *)el); gdome_di_saveDocToFile(domImpl, domdoc, LOCALDIR"/output.xml", GDOME_SAVE_STANDARD, &exc); gdome_el_unref (el, &exc); gdome_doc_unref (domdoc, &exc); if(ret) return 0; else return -1; } gdome2-0.8.1/test/test-cdata.c0000664000076400007640000001357207403635046011563 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* test-cdata.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include void dot() { printf("."); fflush(stdout); } gboolean test_cdata1(GdomeDocument *doc) { GdomeText *txt, *txt1; GdomeNode *node; GdomeException exc; GdomeDOMString *str; GdomeNodeList *nl; gboolean ret = TRUE; str = gdome_str_mkref ("Initial String"); txt = gdome_doc_createTextNode (doc, str, &exc); gdome_str_unref (str); /* Test Text.childNodes */ nl = gdome_t_childNodes (txt, &exc); if (nl == NULL) fprintf (stderr, "\nText.childNodes, NULL"), ret = FALSE; if (gdome_nl_length (nl, &exc) != 0L) fprintf (stderr, "\nText.childNodes, not empty"), ret = FALSE; if ((node = gdome_nl_item (nl, 0L, &exc)) != NULL) fprintf (stderr, "\nText.childNodes, not empty"), ret = FALSE; gdome_nl_unref (nl, &exc); dot(); /* Test Text.length */ if (gdome_t_length (txt, &exc) != 14) fprintf (stderr, "\nText.length, wrong"), ret = FALSE; dot(); /* Test Text.data */ str = gdome_t_data (txt, &exc); if (strcmp(str->str, "Initial String")) fprintf (stderr, "\nText.data, wrong"), ret = FALSE; gdome_str_unref (str); dot(); /* Test Text.set_data */ str = gdome_str_mkref ("0123456789"); gdome_t_set_data (txt, str, &exc); gdome_str_unref (str); str = gdome_t_data (txt, &exc); if (strcmp(str->str, "0123456789")) fprintf (stderr, "\nText.set_data, wrong"), ret = FALSE; gdome_str_unref (str); dot(); /* Test Text.substringData() */ str = gdome_t_substringData (txt, 3L, 3L, &exc); if (strcmp (str->str, "345")) fprintf (stderr, "\nText.substringData(3,3), wrong"), ret = FALSE; gdome_str_unref (str); str = gdome_t_substringData (txt, 4L, 10L, &exc); if (strcmp (str->str, "456789")) fprintf (stderr, "\nText.substringData(4,10), wrong"), ret = FALSE; gdome_str_unref(str); dot(); /* Test Text.appendData() */ str = gdome_str_mkref ("ABCDEF"); gdome_t_appendData (txt, str, &exc); gdome_str_unref (str); str = gdome_t_data (txt, &exc); if (strcmp(str->str, "0123456789ABCDEF")) fprintf (stderr, "\nText.appendData, wrong"), ret = FALSE; gdome_str_unref (str); dot(); /* Test Text.insertData() */ str = gdome_str_mkref ("X"); gdome_t_insertData (txt, 3L, str, &exc); gdome_str_unref (str); str = gdome_t_data (txt, &exc); if (strcmp(str->str, "012X3456789ABCDEF")) fprintf (stderr, "\nText.insertData, wrong"), ret = FALSE; gdome_str_unref (str); dot(); /* Test Text.deleteData() */ gdome_t_deleteData (txt, 3L, 1L, &exc); str = gdome_t_data (txt, &exc); if (strcmp(str->str, "0123456789ABCDEF")) fprintf (stderr, "\nText.deleteData(3,1), wrong"), ret = FALSE; gdome_str_unref (str); gdome_t_deleteData (txt, 10L, 8L, &exc); str = gdome_t_data (txt, &exc); if (strcmp(str->str, "0123456789")) fprintf (stderr, "\nText.deleteData(10,8), wrong"), ret = FALSE; gdome_str_unref (str); dot(); /* Test Text.replaceData() */ str = gdome_str_mkref ("ABC"); gdome_t_replaceData (txt, 0L, 3L, str, &exc); gdome_str_unref (str); str = gdome_t_data (txt, &exc); if (strcmp(str->str, "ABC3456789")) fprintf (stderr, "\nText.replaceData(0,3,\"ABC\"), wrong"), ret = FALSE; gdome_str_unref (str); str = gdome_str_mkref ("XXXXXX"); gdome_t_replaceData (txt, 4L, 3L, str, &exc); gdome_str_unref (str); str = gdome_t_data (txt, &exc); if (strcmp(str->str, "ABC3XXXXXX789")) fprintf (stderr, "\nText.replaceData(4,3,\"XXXXXX\"), wrong"), ret = FALSE; gdome_str_unref(str); str = gdome_str_mkref ("XABCDEF"); gdome_t_replaceData (txt, 12L, 1L, str, &exc); gdome_str_unref (str); str = gdome_t_data (txt, &exc); if (strcmp(str->str, "ABC3XXXXXX78XABCDEF")) fprintf (stderr, "\nText.replaceData(12,1,\"XABCDEF\"), wrong"), ret = FALSE; gdome_str_unref (str); dot(); printf ("test_cdata1\n"); /* Test Text.splitText */ txt1 = gdome_t_splitText (txt, 10L, &exc); str = gdome_t_data (txt, &exc); if (strcmp(str->str, "ABC3XXXXXX")) fprintf (stderr, "\nText.splitText(10), wrong"), ret = FALSE; gdome_str_unref (str); str = gdome_t_data (txt1, &exc); if (strcmp(str->str, "78XABCDEF")) fprintf (stderr, "\nText1.splitText(10), wrong"), ret = FALSE; gdome_str_unref (str); node = gdome_t_nextSibling (txt, &exc); if (node != (GdomeNode *)txt1) fprintf (stderr, "\nText.splitText(10), wrong next"), ret = FALSE; gdome_n_unref (node, &exc); node = gdome_t_previousSibling (txt1, &exc); if (node != (GdomeNode *)txt) fprintf (stderr, "\nText1.splitText(10), wrong previous"), ret = FALSE; gdome_n_unref (node, &exc); dot(); printf ("test_text1\n"); gdome_t_unref (txt, &exc); gdome_t_unref (txt1, &exc); return ret; } int main (int argc, char **argv) { GdomeDOMImplementation *domImpl = NULL; GdomeDocument *domdoc = NULL; GdomeDOMString *str = NULL; GdomeException exc = 0; gboolean ret; domImpl = gdome_di_mkref(); str = gdome_str_mkref ("TEST"); domdoc = gdome_di_createDocument (domImpl, NULL, str, NULL, &exc); gdome_str_unref (str); ret = test_cdata1(domdoc); gdome_doc_unref(domdoc, &exc); if(ret) return 0; else return -1; } gdome2-0.8.1/test/test-dtd.c0000664000076400007640000001622307403635046011256 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* test-dtd.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include void dot() { printf("."); fflush(stdout); } gboolean test_dtd (GdomeDocument *doc) { GdomeDocumentType *dt; GdomeNamedNodeMap *ents, *nots; GdomeNodeList *nl; GdomeNode *node; GdomeDOMString *str; GdomeException exc; GdomeEntity *ent; GdomeNotation *not; gboolean ret = TRUE; dt = gdome_doc_doctype (doc, &exc); /* Test DocumentType.childNodes */ nl = gdome_dt_childNodes (dt, &exc); if (nl == NULL) fprintf (stderr, "\nDocumentType.childNodes, NULL"), ret = FALSE; if (gdome_nl_length (nl, &exc) != 0L) fprintf (stderr, "\nDocumentType.childNodes, not empty"), ret = FALSE; if ((node = gdome_nl_item (nl, 0L, &exc)) != NULL) fprintf (stderr, "\nDocumentType.childNodes, not empty"), ret = FALSE; gdome_nl_unref (nl, &exc); dot(); /* Test DocumentType.name */ str = gdome_dt_name (dt, &exc); if (str == NULL) fprintf (stderr, "\nDocumentType.name, NULL"), ret = FALSE; else if (ret && strcmp (str->str, "TEST-DTD")) fprintf (stderr, "\nDocumentType.name, wrong"), ret = FALSE; if (ret) gdome_str_unref (str); dot(); /* Test DocumentType.publicId */ str = gdome_dt_publicId (dt, &exc); if (str != NULL) { fprintf (stderr, "\nDocumentType.publicId, wrong"), ret = FALSE; gdome_str_unref (str); } dot(); /* Test DocumentType.systemId */ str = gdome_dt_systemId (dt, &exc); if (str == NULL) fprintf (stderr, "\nDocumentType.systemId, NULL"), ret = FALSE; else if (ret && strcmp (str->str, "test-dtd.dtd")) fprintf (stderr, "\nDocumentType.systemId, wrong"), ret = FALSE; if (ret) gdome_str_unref (str); dot(); /* Test DocumentType.internalSubset */ str = gdome_dt_internalSubset (dt, &exc); if (str == NULL) fprintf (stderr, "\nDocumentType.internalSubset, NULL"), ret = FALSE; else if (ret && strcmp (str->str, "")) fprintf (stderr, "\nDocumentType.internalSubset, wrong"), ret = FALSE; if (ret) gdome_str_unref (str); dot(); /* Test DocumentType.entities */ ents = gdome_dt_entities (dt, &exc); if (ents == NULL) fprintf (stderr, "\nDocumentType.entities, NULL"), ret = FALSE; else if (ret && gdome_nnm_length (ents, &exc) != 5) fprintf (stderr, "\nDocumentType.entities, wrong length"), ret = FALSE; dot(); /* Test DocumentType.notations */ nots = gdome_dt_notations (dt, &exc); if (ents == NULL) fprintf (stderr, "\nDocumentType.notations, NULL"), ret = FALSE; else if (ret && gdome_nnm_length (ents, &exc) != 5) fprintf (stderr, "\nDocumentType.notations, wrong length"), ret = FALSE; dot(); printf ("test_dtd\n"); /* Test Parsed Entity */ str = gdome_str_mkref ("FOO1"); ent = (GdomeEntity *)gdome_nnm_getNamedItem (ents, str, &exc); gdome_str_unref (str); if (ent == NULL) fprintf (stderr, "\nNamedNodeMap.getNamedItem(\"FOO1\"), NULL"), ret = FALSE; str = gdome_ent_nodeName (ent, &exc); if (ret && strcmp (str->str, "FOO1")) fprintf (stderr, "\nEntity.nodeName(), (parsed) FOO1 wrong nodeName"), ret = FALSE; gdome_str_unref (str); if (ret && gdome_ent_publicId (ent, &exc) != NULL) fprintf (stderr, "\nEntity.publicId(), (parsed) FOO1 NOT NULL"), ret = FALSE; if (ret && gdome_ent_systemId (ent, &exc) != NULL) fprintf (stderr, "\nEntity.systemId(), (parsed) FOO1 NOT NULL"), ret = FALSE; if (ret && gdome_ent_notationName (ent, &exc) != NULL) fprintf (stderr, "\nEntity.notationName(), (parsed) FOO1 NOT NULL"), ret = FALSE; if (ret) gdome_ent_unref (ent, &exc); dot(); /* Test Unparsed Entity */ str = gdome_str_mkref ("FOO2"); ent = (GdomeEntity *)gdome_nnm_getNamedItem (ents, str, &exc); gdome_str_unref (str); if (ent == NULL) fprintf (stderr, "\nNamedNodeMap.getNamedItem(\"FOO2\"), NULL"), ret = FALSE; str = gdome_ent_nodeName (ent, &exc); if (ret && strcmp (str->str, "FOO2")) fprintf (stderr, "\nEntity.nodeName(), (unparsed) FOO2 wrong"), ret = FALSE; gdome_str_unref (str); if (ret && gdome_ent_publicId (ent, &exc) != NULL) fprintf (stderr, "\nEntity.publicId(), (unparsed) NOT NULL"), ret = FALSE; str = gdome_ent_systemId (ent, &exc); if (ret && strcmp (str->str, "file.type2")) fprintf (stderr, "\nEntity.systemId(), (unparsed) FOO2 wrong"), ret = FALSE; gdome_str_unref (str); str =gdome_ent_notationName (ent, &exc); if (ret && strcmp (str->str, "type2")) fprintf (stderr, "\nEntity.notationName(), (unparsed) FOO2 wrong"), ret = FALSE; gdome_str_unref (str); if (ret) gdome_ent_unref (ent, &exc); dot(); printf ("test_entity\n"); /* Test Notation */ str = gdome_str_mkref ("type1"); not = (GdomeNotation *)gdome_nnm_getNamedItem (nots, str, &exc); gdome_str_unref (str); if (not == NULL) fprintf (stderr, "\nNamedNodeMap.getNamedItem(\"type1\"), NULL"), ret = FALSE; str = gdome_not_nodeName (not, &exc); if (ret && strcmp (str->str, "type1")) fprintf (stderr, "\nNotation.nodeName(), wrong nodeName"), ret = FALSE; gdome_str_unref (str); if (ret && gdome_not_publicId (not, &exc) != NULL) fprintf (stderr, "\nNotation.publicId(), NOT NULL"), ret = FALSE; str = gdome_not_systemId (not, &exc); if (ret && strcmp (str->str, "program1")) fprintf (stderr, "\nNotation.systemId(), wrong"), ret = FALSE; gdome_str_unref (str); /* Test Notation.childNodes */ nl = gdome_not_childNodes (not, &exc); if (nl == NULL) fprintf (stderr, "\nNotation.childNodes, NULL"), ret = FALSE; if (gdome_nl_length (nl, &exc) != 0L) fprintf (stderr, "\nNotation.childNodes, not empty"), ret = FALSE; if ((node = gdome_nl_item (nl, 0L, &exc)) != NULL) fprintf (stderr, "\nNotation.childNodes, not empty"), ret = FALSE; gdome_nl_unref (nl, &exc); if (ret) gdome_not_unref (not, &exc); dot(); printf ("test_notation\n"); gdome_nnm_unref (ents, &exc); gdome_nnm_unref (nots, &exc); gdome_dt_unref (dt, &exc); return ret; } int main (int argc, char **argv) { GdomeDOMImplementation *domImpl = NULL; GdomeDocument *domdoc = NULL; GdomeException exc = 0; gboolean ret; domImpl = gdome_di_mkref(); domdoc = gdome_di_createDocFromURI (domImpl, LOCALDIR"/test-dtd.xml", GDOME_LOAD_VALIDATING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOImplementation.createDocFromURI: failed\n test-dtd.xml not found\n"); return -1; } ret = test_dtd(domdoc); gdome_doc_unref(domdoc, &exc); if(ret) return 0; else return -1; } gdome2-0.8.1/test/test-element.c0000664000076400007640000005436007436563011012136 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* test-element.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include void dot() { printf("."); fflush(stdout); } gboolean test_el(GdomeElement *el) { GdomeNamedNodeMap *nnm; GdomeAttr *attr; GdomeAttr *attrNS; GdomeAttr *attrDef; GdomeAttr *attr_temp; GdomeDOMString *attr_name; GdomeDOMString *attr_value; GdomeDOMString *attr_URI; GdomeDOMString *temp_str; GdomeDOMString *cmp_str; GdomeException exc; gboolean ret = TRUE; /* test Element::tagName */ temp_str = gdome_el_tagName(el, &exc); cmp_str = gdome_str_mkref("TEST"); if(!gdome_str_equal(temp_str, cmp_str)) fprintf(stderr,"\nElement.tagName(), wrong"), ret = FALSE; gdome_str_unref (temp_str); gdome_str_unref (cmp_str); dot(); /* test Element::attributes */ nnm = gdome_el_attributes(el, &exc); if(nnm == NULL) fprintf(stderr,"\nElement.attributes, NULL"), ret = FALSE; else gdome_nnm_unref(nnm, &exc); dot(); /* test Element::getAttributeNode */ attr_name = gdome_str_mkref("XXXX"); attr = gdome_el_getAttributeNode(el, attr_name, &exc); if(attr != NULL) fprintf(stderr,"\nElement.getAttributeNode(\"%s\"), NOT NULL",attr_name->str), ret = FALSE; gdome_str_unref (attr_name); attr_name = gdome_str_mkref("FOO1"); attr = gdome_el_getAttributeNode(el, attr_name, &exc); if(attr == NULL) fprintf(stderr,"\nElement.getAttributeNode(\"%s\"), NULL",attr_name->str), ret = FALSE; else { cmp_str = gdome_a_nodeName(attr, &exc); if(ret && !gdome_str_equal(cmp_str, attr_name)) fprintf(stderr,"\nElement.getAttributeNode(\"%s\"), wrong",attr_name->str), ret = FALSE; } gdome_str_unref (attr_name); gdome_str_unref (cmp_str); dot(); /* test Element::getAttributeNodeNS */ attr_name = gdome_str_mkref("CIPPO2"); attr_URI = gdome_str_mkref("urn:xxxx.xxxx.xx"); attrNS = gdome_el_getAttributeNodeNS(el, attr_URI, attr_name, &exc); if(attrNS != NULL) fprintf(stderr,"\nElement.getAttributeNodeNS(\"%s\",\"%s\"), NOT NULL",attr_URI->str,attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_URI); attr_name = gdome_str_mkref("XXXXX"); attr_URI = gdome_str_mkref("urn:cips.ciak.uk"); attrNS = gdome_el_getAttributeNodeNS(el, attr_URI, attr_name, &exc); if(attrNS != NULL) fprintf(stderr,"\nElement.getAttributeNodeNS(\"%s\",\"%s\"), NOT NULL",attr_URI->str,attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_URI); attr_name = gdome_str_mkref("CIPPO2"); attr_URI = gdome_str_mkref("urn:cips.ciak.uk"); attrNS = gdome_el_getAttributeNodeNS(el, attr_URI, attr_name, &exc); gdome_str_unref (attr_name); gdome_str_unref (attr_URI); if(attrNS == NULL) fprintf(stderr,"\nElement.getAttributeNodeNS(\"%s\",\"%s\"), NULL",attr_URI->str,attr_name->str), ret = FALSE; else { attr_name = gdome_a_nodeName(attrNS,&exc); cmp_str = gdome_str_mkref("pippo:CIPPO2"); if(ret && !gdome_str_equal(attr_name, cmp_str)) fprintf(stderr,"\nElement.getAttributeNodeNS(\"%s\",\"%s\"), wrong",attr_URI->str,attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (cmp_str); } dot(); /* test Element::removeAttributeNode */ attr_name = gdome_str_mkref("FOO1"); attr = gdome_el_removeAttributeNode(el, attr, &exc); gdome_a_unref (attr, &exc); if(attr == NULL) fprintf(stderr,"\nElement.removeAttributeNode(attr), NULL"), ret = FALSE; else { cmp_str = gdome_a_nodeName(attr,&exc); if(ret && !gdome_str_equal(cmp_str, attr_name)) fprintf(stderr,"\nElement.removeAttributeNode(attr), wrong"), ret = FALSE; gdome_str_unref (cmp_str); if(ret && gdome_el_getAttributeNode(el, attr_name, &exc) != NULL) fprintf(stderr,"\nElement.removeAttributeNode(attr), error"), ret = FALSE; gdome_str_unref (attr_name); } attr_name = gdome_str_mkref("CIPPO2"); attr_URI = gdome_str_mkref("urn:cips.ciak.uk"); attrNS = gdome_el_removeAttributeNode(el, attrNS, &exc); gdome_a_unref (attrNS, &exc); if(attr == NULL) fprintf(stderr,"\nElement.removeAttributeNode(attrNS), NULL"), ret = FALSE; else { temp_str = gdome_a_nodeName(attrNS,&exc); cmp_str = gdome_str_mkref("pippo:CIPPO2"); if(ret && !gdome_str_equal(temp_str, cmp_str)) fprintf(stderr,"\nElement.removeAttributeNode(attrNS), wrong"), ret = FALSE; gdome_str_unref (cmp_str); gdome_str_unref (temp_str); if(ret && gdome_el_getAttributeNodeNS(el, attr_URI, attr_name, &exc) != NULL) fprintf(stderr,"\nElement.removeAttributeNode(attrNS), error"), ret = FALSE; gdome_str_unref (attr_URI); gdome_str_unref (attr_name); } attr_name = gdome_str_mkref("FOO2"); attr_value = gdome_str_mkref("ciccia2"); attrDef = gdome_el_getAttributeNode(el, attr_name, &exc); attrDef = gdome_el_removeAttributeNode(el, attrDef, &exc); gdome_a_unref (attrDef, &exc); if(attrDef == NULL) fprintf(stderr,"\nElement.removeAttributeNode(attrDef), NULL"), ret = FALSE; else { cmp_str = gdome_a_nodeName(attrDef,&exc); if(ret && !gdome_str_equal(cmp_str, attr_name)) fprintf(stderr,"\nElement.removeAttributeNode(attrDef), wrong"); else { gdome_str_unref (cmp_str); gdome_a_unref (attrDef, &exc); attrDef = gdome_el_getAttributeNode(el, attr_name, &exc); if(ret && attrDef == NULL) fprintf(stderr,"\nElement.removeAttributeNode(attrDef), error1"), ret = FALSE; else { cmp_str = gdome_a_nodeName(attrDef,&exc); temp_str = gdome_a_nodeValue(attrDef,&exc); if(ret && (!gdome_str_equal(cmp_str, attr_name) || !gdome_str_equal(temp_str, temp_str))) fprintf(stderr,"\nElement.removeAttributeNode(attrDef), error2"), ret = FALSE; gdome_str_unref (cmp_str); gdome_str_unref (temp_str); gdome_str_unref (attr_name); gdome_str_unref (attr_value); gdome_a_unref (attrDef, &exc); } } } dot(); /* test Element::setAttributeNode */ attr_name = gdome_str_mkref("FOO1"); attr_temp = gdome_el_setAttributeNode(el, attr, &exc); gdome_a_unref (attr, &exc); if(attr_temp != NULL) fprintf(stderr,"\nElement.setAttributeNode(attr), NOT NULL"), ret = FALSE; else if(ret && (attr = gdome_el_getAttributeNode(el, attr_name, &exc)) == NULL) fprintf(stderr,"\nElement.setAttributeNode(attr), error1"), ret = FALSE; else { cmp_str = gdome_a_nodeName(attr,&exc); if(ret && !gdome_str_equal(cmp_str, attr_name)) fprintf(stderr,"\nElement.setAttributeNode(attr), error2"), ret = FALSE; gdome_str_unref (cmp_str); gdome_str_unref (attr_name); gdome_a_unref (attr, &exc); } dot(); /* test Element::setAttributeNodeNS */ attr_name = gdome_str_mkref("CIPPO2"); attr_URI = gdome_str_mkref("urn:cips.ciak.uk"); attr_temp = gdome_el_setAttributeNodeNS(el, attrNS, &exc); gdome_a_unref (attrNS, &exc); if(attr_temp != NULL) fprintf(stderr,"\nElement.setAttributeNodeNS(attrNS), NOT NULL"), ret = FALSE; else if(ret && (attrNS = gdome_el_getAttributeNodeNS(el, attr_URI, attr_name, &exc)) == NULL) fprintf(stderr,"\nElement::setAttributeNodeNS(attrNS), error1"), ret = FALSE; else { gdome_str_unref (attr_name); gdome_str_unref (attr_URI); attr_name = gdome_a_nodeName(attrNS,&exc); cmp_str = gdome_str_mkref("pippo:CIPPO2"); if(ret && !gdome_str_equal(attr_name, cmp_str)) fprintf(stderr,"\nElement.setAttributeNodeNS(attrNS), error2"), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (cmp_str); gdome_a_unref (attr_temp, &exc); gdome_a_unref (attrNS, &exc); } dot(); /* test Element::getAttribute */ attr_name = gdome_str_mkref("FOO3"); temp_str = gdome_el_getAttribute(el, attr_name, &exc); if(temp_str == NULL) fprintf(stderr,"\nElement.getAttribute(\"%s\"), NULL", attr_name->str), ret = FALSE; else { cmp_str = gdome_str_mkref("bar3"); if(ret && !gdome_str_equal(temp_str, cmp_str)) fprintf(stderr,"\nElement.getAttribute(\"%s\"), wrong", attr_name->str), ret = FALSE; gdome_str_unref (cmp_str); gdome_str_unref (temp_str); gdome_str_unref (attr_name); } attr_name = gdome_str_mkref("XXXX"); temp_str = gdome_el_getAttribute(el, attr_name, &exc); cmp_str = gdome_str_mkref (""); if(!gdome_str_equal (temp_str, cmp_str)) fprintf(stderr,"\nElement.getAttribute(\"%s\"), NOT empty", attr_name->str), ret = FALSE; gdome_str_unref (cmp_str); gdome_str_unref (temp_str); gdome_str_unref (attr_name); dot(); /* test Element::getAttributeNS */ attr_name = gdome_str_mkref("CIPPO3"); attr_URI = gdome_str_mkref("urn:cips.ciak.uk"); temp_str = gdome_el_getAttributeNS(el, attr_URI, attr_name, &exc); gdome_str_unref (attr_name); gdome_str_unref (attr_URI); if(temp_str == NULL) fprintf(stderr,"\nElement.getAttributeNS(\"%s\",\"%s\"), NULL", attr_URI->str,attr_name->str), ret = FALSE; else { cmp_str = gdome_str_mkref("lippo3"); if(ret && !gdome_str_equal(temp_str, cmp_str)) fprintf(stderr,"\nElement::getAttributeNS(\"%s\",\"%s\"), wrong", attr_URI->str, attr_name->str), ret = FALSE; gdome_str_unref (temp_str); gdome_str_unref (cmp_str); } attr_name = gdome_str_mkref("XXXX"); attr_URI = gdome_str_mkref("urn:cips.ciak.uk"); temp_str = gdome_el_getAttributeNS(el, attr_URI, attr_name, &exc); cmp_str = gdome_str_mkref (""); if(!gdome_str_equal (temp_str, cmp_str)) fprintf(stderr,"\nElement::getAttribute(\"%s\",\"%s\"), NOT empty", attr_URI->str, attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_URI); gdome_str_unref (temp_str); attr_name = gdome_str_mkref("CIPPO3"); attr_URI = gdome_str_mkref("urn:xxxx.xxxx.xx"); temp_str = gdome_el_getAttributeNS(el, attr_URI, attr_name, &exc); if(!gdome_str_equal (temp_str, cmp_str)) fprintf(stderr,"\nElement::getAttribute(\"%s\",\"%s\"), NOT empty", attr_URI->str, attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_URI); gdome_str_unref (temp_str); gdome_str_unref (cmp_str); dot(); /* test Element::setAttribute */ attr_name = gdome_str_mkref("NEWATTR"); attr_value = gdome_str_mkref("newvalue"); gdome_el_setAttribute(el, attr_name, attr_value, &exc); temp_str = gdome_el_getAttribute(el, attr_name, &exc); if(temp_str == NULL) fprintf(stderr,"\nElement::setAttribute(\"%s\",\"%s\"), NULL", attr_name->str, attr_value->str), ret = FALSE; else if(ret && !gdome_str_equal(attr_value, temp_str)) fprintf(stderr,"\nElement::setAttribute(\"%s\",\"%s\"), wrong", attr_name->str, attr_value->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_value); gdome_str_unref (temp_str); dot(); /* test Element::setAttributeNS */ attr_name = gdome_str_mkref("myns:NEWATTR1"); attr_value = gdome_str_mkref("newvalue1"); attr_URI = gdome_str_mkref("urn:myns.casarini.org"); gdome_el_setAttributeNS(el, attr_URI, attr_name, attr_value, &exc); gdome_str_unref (attr_name); attr_name = gdome_str_mkref("NEWATTR1"); temp_str = gdome_el_getAttributeNS(el, attr_URI, attr_name, &exc); if(temp_str == NULL) fprintf(stderr,"\nElement::setAttributeNS(\"%s\",\"%s\",\"%s\"), NULL", attr_URI->str, attr_name->str, attr_value->str), ret = FALSE; else if(ret && !gdome_str_equal(attr_value, temp_str)) fprintf(stderr,"\nElement::setAttributeNS(\"%s\",\"%s\",\"%s\"), wrong", attr_URI->str, attr_name->str, attr_value->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_URI); gdome_str_unref (attr_value); gdome_str_unref (temp_str); dot(); /* test Element::removeAttribute */ attr_name = gdome_str_mkref("FOO4"); gdome_el_removeAttribute(el, attr_name, &exc); temp_str = gdome_el_getAttribute(el, attr_name, &exc); cmp_str = gdome_str_mkref (""); if(!gdome_str_equal (temp_str, cmp_str)) fprintf(stderr,"\nElement::removeAttribute(\"%s\"), NOT NULL", attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (temp_str); gdome_str_unref (cmp_str); dot(); /* test Element::removeAttributeNS */ attr_name = gdome_str_mkref("CIPPO4"); attr_URI = gdome_str_mkref("urn:cips.ciak.uk"); gdome_el_removeAttributeNS(el, attr_URI, attr_name, &exc); temp_str = gdome_el_getAttributeNS(el, attr_URI, attr_name, &exc); cmp_str = gdome_str_mkref (""); if(!gdome_str_equal (temp_str, cmp_str)) fprintf(stderr,"\nElement::removeAttributeNS(\"%s\",\"%s\"), failed", attr_URI->str,attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_URI); gdome_str_unref (temp_str); gdome_str_unref (cmp_str); dot(); /* test Element::hasAttribute */ attr_name = gdome_str_mkref("NEWATTR"); if (!gdome_el_hasAttribute(el, attr_name, &exc)) fprintf(stderr,"\nElement::hasAttrbute(\"%s\"), wrong", attr_name->str), ret = FALSE; gdome_str_unref (attr_name); attr_name = gdome_str_mkref("BOBOBO"); if (gdome_el_hasAttribute(el, attr_name, &exc)) fprintf(stderr,"\nElement::hasAttribute(\"%s\")2, wrong", attr_name->str), ret = FALSE; gdome_str_unref (attr_name); dot(); /* test Element::hasAttributeNS */ attr_name = gdome_str_mkref("NEWATTR1"); attr_URI = gdome_str_mkref("urn:myns.casarini.org"); if (!gdome_el_hasAttributeNS(el, attr_URI, attr_name, &exc)) fprintf(stderr,"\nElement::hasAttrbuteNS(\"%s\",\"%s\"), wrong", attr_URI->str, attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_URI); attr_name = gdome_str_mkref("BOBOBO"); attr_URI = gdome_str_mkref("urn:myns.casarini.org"); if (gdome_el_hasAttributeNS(el, attr_URI, attr_name, &exc)) fprintf(stderr,"\nElement::hasAttrbuteNS(\"%s\",\"%s\"), wrong", attr_URI->str, attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_URI); attr_name = gdome_str_mkref("NEWATTR1"); attr_URI = gdome_str_mkref("urn:myns.xxxx.xx"); if (gdome_el_hasAttributeNS(el, attr_URI, attr_name, &exc)) fprintf(stderr,"\nElement::hasAttrbuteNS(\"%s\",\"%s\"), wrong", attr_URI->str, attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_URI); dot(); printf("test_el\n"); return ret; } gboolean test_xmlns(GdomeElement *el) { GdomeAttr *attrNS, *attr; GdomeDOMString *attr_name; GdomeDOMString *attr_value; GdomeDOMString *attr_URI; GdomeDOMString *temp_str; GdomeDOMString *cmp_str = NULL; gboolean ret = TRUE; GdomeException exc; /* test Element::getAttributeNode */ attr_name = gdome_str_mkref("xmlns"); attr = gdome_el_getAttributeNode(el, attr_name, &exc); if(attr == NULL) fprintf(stderr,"\nElement.getAttributeNode(\"%s\"), NULL",attr_name->str), ret = FALSE; else { cmp_str = gdome_a_nodeName(attr, &exc); if(ret && !gdome_str_equal(cmp_str, attr_name)) fprintf(stderr,"\nElement.getAttributeNode(\"%s\"), wrong",attr_name->str), ret = FALSE; else { gdome_str_unref (cmp_str); cmp_str = gdome_a_value(attr, &exc); if (cmp_str == NULL) fprintf(stderr,"\nAttribute.value(\"%s\"), NULL",attr_name->str), ret = FALSE; else { temp_str = gdome_str_mkref ("http://test.org/"); if(ret && !gdome_str_equal(cmp_str, temp_str)) fprintf(stderr,"\nAttribute.value(\"%s\"), wrong",cmp_str->str), ret = FALSE; gdome_str_unref (temp_str); } } } gdome_str_unref (attr_name); gdome_str_unref (cmp_str); gdome_a_unref (attr, &exc); dot(); /* test Element::hasAttribute */ attr_name = gdome_str_mkref("xmlns"); if (!gdome_el_hasAttribute(el, attr_name, &exc)) fprintf(stderr,"\nElement::hasAttrbute(\"%s\"), wrong", attr_name->str), ret = FALSE; gdome_str_unref (attr_name); dot(); /* test Element::getAttributeNS */ attr_name = gdome_str_mkref("pippo"); attr_URI = gdome_str_mkref("http://www.w3.org/2000/xmlns/"); temp_str = gdome_el_getAttributeNS(el, attr_URI, attr_name, &exc); gdome_str_unref (attr_name); gdome_str_unref (attr_URI); if(temp_str == NULL) fprintf(stderr,"\nElement.getAttributeNS(\"%s\",\"%s\"), NULL", attr_URI->str,attr_name->str), ret = FALSE; else { cmp_str = gdome_str_mkref("urn:cips.ciak.uk"); if(ret && !gdome_str_equal(temp_str, cmp_str)) fprintf(stderr,"\nElement::getAttributeNS(\"%s\",\"%s\"), wrong", attr_URI->str, attr_name->str), ret = FALSE; gdome_str_unref (temp_str); gdome_str_unref (cmp_str); } dot(); /* test Element::getAttributeNodeNS */ attr_name = gdome_str_mkref("CIPPO2"); attr_URI = gdome_str_mkref("http://www.w3.org/2000/xmlns/"); attrNS = gdome_el_getAttributeNodeNS(el, attr_URI, attr_name, &exc); if(attrNS != NULL) fprintf(stderr,"\nElement.getAttributeNodeNS(\"%s\",\"%s\"), NOT NULL",attr_URI->str,attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_URI); attr_name = gdome_str_mkref("pippo"); attr_URI = gdome_str_mkref("http://www.w3.org/2000/xmlns/"); attrNS = gdome_el_getAttributeNodeNS(el, attr_URI, attr_name, &exc); gdome_str_unref (attr_name); gdome_str_unref (attr_URI); if(attrNS == NULL) fprintf(stderr,"\nElement.getAttributeNodeNS(\"%s\",\"%s\"), NULL",attr_URI->str,attr_name->str), ret = FALSE; else { attr_name = gdome_a_nodeName(attrNS,&exc); cmp_str = gdome_str_mkref("xmlns:pippo"); if(ret && !gdome_str_equal(attr_name, cmp_str)) fprintf(stderr,"\nElement.getAttributeNodeNS(\"%s\",\"%s\"), wrong",attr_URI->str,attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (cmp_str); } gdome_a_unref (attrNS, &exc); dot(); /* test Element::setAttributeNS */ attr_name = gdome_str_mkref("xmlns:myns"); attr_value = gdome_str_mkref("http://www.myns.com/"); attr_URI = gdome_str_mkref("http://www.w3.org/2000/xmlns/"); gdome_el_setAttributeNS(el, attr_URI, attr_name, attr_value, &exc); gdome_str_unref (attr_name); attr_name = gdome_str_mkref("myns"); temp_str = gdome_el_getAttributeNS(el, attr_URI, attr_name, &exc); if(temp_str == NULL) fprintf(stderr,"\nElement::setAttributeNS(\"%s\",\"%s\",\"%s\"), NULL", attr_URI->str, attr_name->str, attr_value->str), ret = FALSE; else if(ret && !gdome_str_equal(attr_value, temp_str)) fprintf(stderr,"\nElement::setAttributeNS(\"%s\",\"%s\",\"%s\"), wrong", attr_URI->str, attr_name->str, attr_value->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_URI); gdome_str_unref (attr_value); gdome_str_unref (temp_str); dot(); /* test Element::removeAttribute */ attr_name = gdome_str_mkref("xmlns"); gdome_el_removeAttribute(el, attr_name, &exc); temp_str = gdome_el_getAttribute(el, attr_name, &exc); cmp_str = gdome_str_mkref (""); if(!gdome_str_equal (temp_str, cmp_str)) fprintf(stderr,"\nElement::removeAttribute(\"%s\"), NOT NULL", attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (temp_str); gdome_str_unref (cmp_str); dot(); /* test Element::hasAttribute */ attr_name = gdome_str_mkref("xmlns"); if (gdome_el_hasAttribute(el, attr_name, &exc)) fprintf(stderr,"\nElement::hasAttrbute(\"%s\"), wrong", attr_name->str), ret = FALSE; gdome_str_unref (attr_name); dot(); /* test Element::setAttribute */ attr_name = gdome_str_mkref("xmlns"); attr_value = gdome_str_mkref("http://a.com"); gdome_el_setAttribute(el, attr_name, attr_value, &exc); temp_str = gdome_el_getAttribute(el, attr_name, &exc); if(!gdome_str_equal (temp_str, attr_value)) fprintf(stderr,"\nElement::setAttribute(\"%s\"), wrong != %s", attr_name->str, temp_str->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (attr_value); gdome_str_unref (temp_str); /* test Element::getAttributeNode */ attr_name = gdome_str_mkref("xmlns"); attr = gdome_el_getAttributeNode(el, attr_name, &exc); gdome_str_unref (attr_name); if(attr == NULL) fprintf(stderr,"\nElement.getAttributeNode(\"%s\"), NULL",attr_name->str), ret = FALSE; else { attr_name = gdome_a_nodeName(attr,&exc); cmp_str = gdome_str_mkref("xmlns"); if(ret && !gdome_str_equal(attr_name, cmp_str)) fprintf(stderr,"\nElement.getAttributeNode(\"%s\"), wrong",attr_name->str), ret = FALSE; gdome_str_unref (attr_name); gdome_str_unref (cmp_str); } dot(); gdome_a_unref (attr, &exc); printf("test_xmlns\n"); return ret; } /* this function would segfault in gdome2 0.7.0, due to a problem * with gdome_nnm_unref decreasing the livenodes since doc->refcnt == 0 * fixed problem by adding a workaround in increase livenodes in * gdome_xml_doc_mkref when doc->refcnt == 0 */ gboolean test_el2(GdomeDocument *domdoc) { GdomeElement *el; GdomeNodeList *nl; unsigned long i, lun; gboolean ret = TRUE; GdomeNamedNodeMap *attr; GdomeNode *childs[7]; GdomeException exc; el = gdome_doc_documentElement (domdoc, &exc); gdome_n_unref ((GdomeNode *)domdoc, &exc); nl = gdome_n_childNodes((GdomeNode *)el, &exc); lun = gdome_nl_length(nl, &exc); for(i=0; i * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include void dot() { printf("."); fflush(stdout); } gboolean test_nl(GdomeElement *el) { GdomeNodeList *nl; GdomeDOMString *name; GdomeDOMString *URI; GdomeException exc; GdomeNode *node, *childs[7], *tmp; unsigned long lun, i; gboolean ret = TRUE; /* test NodeList.length */ name = gdome_str_mkref("NODE"); nl = gdome_el_getElementsByTagName(el, name, &exc); lun = gdome_nl_length(nl, &exc); if(lun != 19) fprintf(stderr,"\nNodeList.length(NULL,\"%s\"), wrong",name->str), ret = FALSE; gdome_str_unref (name); gdome_nl_unref(nl, &exc); name = gdome_str_mkref("*"); nl = gdome_el_getElementsByTagName(el, name, &exc); lun = gdome_nl_length(nl, &exc); if(lun != 35) fprintf(stderr,"\nNodeList.length(NULL,\"%s\"), wrong",name->str), ret = FALSE; gdome_str_unref (name); gdome_nl_unref(nl, &exc); name = gdome_str_mkref("OTHER"); nl = gdome_el_getElementsByTagName(el, name, &exc); lun = gdome_nl_length(nl, &exc); if(lun != 16) fprintf(stderr,"\nNodeList.length(NULL,\"%s\"), wrong",name->str), ret = FALSE; gdome_str_unref (name); gdome_nl_unref(nl, &exc); name = gdome_str_mkref("NODE"); URI = gdome_str_mkref("urn:cips.ciak.uk"); nl = gdome_el_getElementsByTagNameNS(el, URI, name, &exc); lun = gdome_nl_length(nl, &exc); if(lun != 9) fprintf(stderr,"\nNodeList.length(\"%s\",\"%s\"), wrong",URI->str,name->str), ret = FALSE; gdome_str_unref (name); gdome_str_unref (URI); gdome_nl_unref(nl, &exc); name = gdome_str_mkref("*"); URI = gdome_str_mkref("urn:cips.ciak.uk"); nl = gdome_el_getElementsByTagNameNS(el, URI, name, &exc); lun = gdome_nl_length(nl, &exc); if(lun != 9) fprintf(stderr,"\nNodeList.length(\"%s\",\"%s\"), wrong",URI->str,name->str), ret = FALSE; gdome_str_unref (name); gdome_str_unref (URI); gdome_nl_unref(nl, &exc); name = gdome_str_mkref("NODE"); URI = gdome_str_mkref("*"); nl = gdome_el_getElementsByTagNameNS(el, URI, name, &exc); lun = gdome_nl_length(nl, &exc); if(lun != 19) fprintf(stderr,"\nNodeList.length(\"%s\",\"%s\"), wrong",URI->str,name->str), ret = FALSE; gdome_str_unref (URI); gdome_str_unref (name); gdome_nl_unref(nl, &exc); dot(); /* test Nodelist::item */ name = gdome_str_mkref("NODE"); nl = gdome_el_getElementsByTagName(el, name, &exc); for(i=0; i<19 && ret;i++) { node = gdome_nl_item(nl, i, &exc); if(node == NULL) fprintf(stderr,"\nNodeList.item(%lu), NULL",i), ret = FALSE; else gdome_n_unref(node,&exc); } gdome_nl_unref(nl, &exc); gdome_str_unref (name); name = gdome_str_mkref("NODE"); URI = gdome_str_mkref("urn:cips.ciak.uk"); nl = gdome_el_getElementsByTagNameNS(el, URI, name, &exc); for(i=0; i<9 && ret;i++) { node = gdome_nl_item(nl, i, &exc); if(node == NULL) fprintf(stderr,"\nNodeList.item(%lu) NS, NULL",i), ret = FALSE; else gdome_n_unref(node,&exc); } gdome_nl_unref(nl, &exc); gdome_str_unref (name); gdome_str_unref (URI); dot(); /* test Nodelist in GdomeNode.childNodes*/ name = gdome_str_mkref("NODE"); nl = gdome_el_getElementsByTagName(el, name, &exc); node = gdome_nl_item(nl, 9L, &exc); gdome_nl_unref(nl, &exc); gdome_str_unref (name); nl = gdome_n_childNodes(node, &exc); lun = gdome_nl_length(nl, &exc); if (lun != 7) fprintf(stderr,"\nNodeList.length() ChildNodes, wrong"), ret = FALSE; for(i=0; i * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define LBUFFER 256 #include #include #include void dot() { printf("."); fflush(stdout); } gboolean test_nnm (GdomeNamedNodeMap *nnm, GdomeElement *el) { GdomeException exc = 0; GdomeDOMString *str; GdomeNode *gnode; GdomeNode *a,*b,*c; gchar buffer[LBUFFER]; long len=0; gint i; gboolean ret = TRUE; /* test inizial length */ len = gdome_nnm_length (nnm, &exc); if(len != 27) fprintf(stderr,"\nNameNodeMap.length, wrong"), ret = FALSE; dot(); /* test the content -readonly-*/ /* test NamedNodeMap.getNamedItem */ len = 27; for (i=3; i<=len && ret; i++) { g_snprintf(buffer,LBUFFER,"FOO%d",i-2); str = gdome_str_mkref(buffer); gnode = gdome_nnm_getNamedItem(nnm, str, &exc); if(gnode == NULL) fprintf(stderr,"\nNamedNodeMap.getNamedItem(\"%s\"), NULL",buffer), ret = FALSE; gdome_str_unref (str); gdome_n_unref (gnode, &exc); } dot(); /* test NamedNodeMap.item */ for (i=0; i<=len && ret; i++) { gnode = gdome_nnm_item(nnm, (unsigned long) i, &exc); if(gnode == NULL && i=len) fprintf(stderr,"\nNamedNodeMap.item(\"%d\"), NOT NULL",i), ret = FALSE; else gdome_n_unref (gnode, &exc); } dot(); /* test NamedNodeMap.removeNamedItem - remove the odd-named element */ for (i=3; i<=len && ret; i+=2) { g_snprintf(buffer,LBUFFER,"FOO%d",i-2); str = gdome_str_mkref(buffer); gnode = gdome_nnm_removeNamedItem(nnm, str, &exc); if(gnode == NULL) fprintf(stderr,"\nNamedNodeMap.removeNamedItem(\"%s\"), NULL",buffer), ret = FALSE; else gdome_n_unref (gnode, &exc); /* test if it has been really removed */ gnode = gdome_nnm_getNamedItem(nnm, str, &exc); if(gnode != NULL) fprintf(stderr,"\nNamedNodeMap.getNamedItem(\"%s\"), NOT NULL",buffer), ret = FALSE; gdome_str_unref (str); } dot(); /* test the post-remove length */ len = gdome_nnm_length (nnm, &exc); if(len != 14) fprintf(stderr,"\nNameNodeMap.length, %lu wrong", len); dot(); /* test if not odd-named are present*/ len = 25; for (i=4; i<=len && ret; i+=2) { g_snprintf(buffer,LBUFFER,"FOO%d",i-2); str = gdome_str_mkref(buffer); gnode = gdome_nnm_getNamedItem(nnm, str, &exc); if(gnode == NULL) fprintf(stderr,"\nNamedNodeMap.getNamedItem(\"%s\"), NULL",buffer), ret = FALSE; else gdome_n_unref (gnode, &exc); gdome_str_unref (str); } dot(); /* test to remove not present element */ str = gdome_str_mkref("FOOBAR"); gnode = gdome_nnm_removeNamedItem(nnm, str, &exc); if (gnode != NULL) fprintf(stderr,"\nNamedNodeMap.removeNamedItem(\"FOOBAR\"), NOT NULL"), ret = FALSE; gdome_str_unref (str); dot(); /* test setNamedItem */ str = gdome_str_mkref("FOO6"); a = gdome_nnm_removeNamedItem(nnm, str, &exc); gnode = gdome_nnm_getNamedItem(nnm, str, &exc); if(gnode != NULL) fprintf(stderr,"\nNamedNodeMap.getNamedItem(\"%s\"), NOT NULL",str->str), ret = FALSE; gdome_str_unref (str); str = gdome_str_mkref("FOO8"); b = gdome_nnm_removeNamedItem(nnm, str, &exc); gnode = gdome_nnm_getNamedItem(nnm, str, &exc); if(gnode != NULL) fprintf(stderr,"\nNamedNodeMap.getNamedItem(\"%s\"), NOT NULL",str->str), ret = FALSE; gdome_str_unref (str); str = gdome_str_mkref("FOO10"); c = gdome_nnm_removeNamedItem(nnm, str, &exc); gnode = gdome_nnm_getNamedItem(nnm, str, &exc); if(gnode != NULL) fprintf(stderr,"\nNamedNodeMap.getNamedItem(\"%s\"), NOT NULL",str->str), ret = FALSE; gdome_str_unref (str); str = gdome_str_mkref("FOO6"); gnode = gdome_nnm_setNamedItem(nnm, a, &exc); if(gnode != NULL) fprintf(stderr,"\nNamedNodeMap.setNamedItem(\"%s\"), NOT NULL",str->str), ret = FALSE; gnode = gdome_nnm_getNamedItem(nnm, str, &exc); if(gnode == NULL) fprintf(stderr,"\nNamedNodeMap.getNamedItem(\"%s\"), NULL",str->str), ret = FALSE; gdome_str_unref (str); gdome_n_unref (gnode, &exc); gdome_n_unref (a, &exc); str = gdome_str_mkref("FOO8"); gnode = gdome_nnm_setNamedItem(nnm, b, &exc); if(gnode != NULL) fprintf(stderr,"\nNamedNodeMap.setNamedItem(\"%s\"), NOT NULL",str->str), ret = FALSE; gnode = gdome_nnm_getNamedItem(nnm, str, &exc); if(gnode == NULL) fprintf(stderr,"\nNamedNodeMap.getNamedItem(\"%s\"), NULL",str->str), ret = FALSE; gdome_str_unref (str); gdome_n_unref (gnode, &exc); gdome_n_unref (b, &exc); str = gdome_str_mkref("FOO10"); gnode = gdome_nnm_setNamedItem(nnm, c, &exc); if(gnode != NULL) fprintf(stderr,"\nNamedNodeMap.setNamedItem(\"%s\"), NOT NULL",str->str), ret = FALSE; gnode = gdome_nnm_getNamedItem(nnm, str, &exc); if(gnode == NULL) fprintf(stderr,"\nNamedNodeMap.getNamedItem(\"%s\"), NULL",str->str), ret = FALSE; gdome_str_unref (str); gdome_n_unref (gnode, &exc); gdome_n_unref (c, &exc); dot(); printf("test_namednodemap\n"); return ret; } int main (int argc, char **argv) { GdomeDOMImplementation *domImpl = NULL; GdomeDocument *domdoc = NULL; GdomeElement *el = NULL; GdomeNamedNodeMap *nnm = NULL; GdomeException exc = 0; gboolean ret; domImpl = gdome_di_mkref(); domdoc = gdome_di_createDocFromURI (domImpl, LOCALDIR"/test-namednodemap.xml", GDOME_LOAD_PARSING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOImplementation.createDocFromUri: failed\n test-namednodemap.xml not found\n"); return -1; } el = gdome_doc_documentElement (domdoc, &exc); if (el == NULL) { fprintf (stderr, "Document.documentElement: NULL\n"); return -1; } nnm = gdome_el_attributes (el, &exc); if (el == NULL) { fprintf (stderr, "ELement.attributes: NULL\n"); return -1; } ret = test_nnm(nnm, el); gdome_nnm_unref (nnm, &exc); gdome_el_unref (el, &exc); gdome_doc_unref (domdoc, &exc); if(ret) return 0; else return -1; } gdome2-0.8.1/test/examplea.c0000664000076400007640000000716407377401317011330 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* examplea.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include int main (int argc, char **argv) { GdomeDOMImplementation *domimpl; GdomeDocument *doc; GdomeElement *root, *el; GdomeText *txtnode; GdomeException exc; GdomeNode *result; GdomeDOMString *name, *value; /* First I get a DOMImplementation reference */ domimpl = gdome_di_mkref (); /* I create a new document with TEST as root element */ name = gdome_str_mkref ("TEST"); doc = gdome_di_createDocument(domimpl, NULL, name, NULL, &exc); if (doc == NULL) { fprintf (stderr, "DOMImplementation.createDocument: failed\n\tException #%d\n", exc); return 1; } gdome_str_unref (name); /* I get reference to the root element of the document */ root = gdome_doc_documentElement (doc, &exc); if (root == NULL) { fprintf (stderr, "Document.documentElement: NULL\n\tException #%d\n", exc); return 1; } /* I set an attribute to the root element */ name = gdome_str_mkref ("PACKAGE"); value = gdome_str_mkref ("gdome2"); gdome_el_setAttribute (root, name, value, &exc); if (exc) { fprintf (stderr, "Element.setAttribute: failed\n\tException #%d\n", exc); return 1; } gdome_str_unref (name); gdome_str_unref (value); /* I create a new element called RELEASE */ name = gdome_str_mkref ("RELEASE"); el = gdome_doc_createElement (doc, name, &exc); if (el == NULL) { fprintf (stderr, "Document.createElement: NULL\n\tException #%d\n", exc); return 1; } gdome_str_unref (name); /* I create a Text Node*/ value = gdome_str_mkref ("0.6.x"); txtnode = gdome_doc_createTextNode (doc, value, &exc); if (txtnode == NULL) { fprintf (stderr, "Document.createTextNode: NULL\n\tException #%d\n", exc); return 1; } gdome_str_unref (value); /* I append the Text Node created to the childs list of the RELEASE element */ result = gdome_el_appendChild (el, (GdomeNode *)txtnode, &exc); if (result != (GdomeNode *)txtnode) { fprintf (stderr, "Element.appendChild: failed\n\tException #%d\n", exc); return 1; } gdome_t_unref(txtnode, &exc); gdome_n_unref(result, &exc); /* I append the RELEASE element to the childs list of the root element */ result = gdome_el_appendChild (root, (GdomeNode *)el, &exc); if (result != (GdomeNode *)el) { fprintf (stderr, "Element.appendChild: failed\n\tException #%d\n", exc); return 1; } gdome_el_unref(el, &exc); gdome_el_unref(root, &exc); gdome_n_unref(result, &exc); /* I save the created document to a file named "examplea.xml */ if (!gdome_di_saveDocToFile (domimpl, doc, LOCALDIR"/examplea.xml", GDOME_SAVE_STANDARD, &exc)) { fprintf (stderr, "DOMImplementation.saveDocToFile: failed\n\tException #%d\n", exc); return 1; } /* I free the document structure and the DOMImplementation */ gdome_doc_unref (doc, &exc); gdome_di_unref (domimpl, &exc); return 0; } gdome2-0.8.1/test/exampleb.c0000664000076400007640000000604507372166422011326 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* exampleb.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include int main (int argc, char **argv) { GdomeDOMImplementation *domimpl; GdomeDocument *doc; GdomeElement *root, *el; GdomeNodeList *childs; GdomeException exc; GdomeDOMString *name, *value; unsigned long i, nchilds; /* First I get a DOMImplementation reference */ domimpl = gdome_di_mkref (); /* I load a new document from the file name "exampleb.xml */ doc = gdome_di_createDocFromURI(domimpl, LOCALDIR"/exampleb.xml", GDOME_LOAD_PARSING, &exc); if (doc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromURI: failed\n\tException #%d\n", exc); return 1; } /* I get reference to the root element of the document */ root = gdome_doc_documentElement (doc, &exc); if (root == NULL) { fprintf (stderr, "Document.documentElement: NULL\n\tException #%d\n", exc); return 1; } /* I get the reference to the childrens NodeList of the root element */ childs = gdome_el_childNodes (root, &exc); if (childs == NULL) { fprintf (stderr, "Element.childNodes: NULL\n\tException #%d\n", exc); return 1; } /* I add the attribute CHECKED="yes" to all element childs of the root element */ name = gdome_str_mkref ("CHECKED"); value = gdome_str_mkref ("yes"); nchilds = gdome_nl_length (childs, &exc); for (i = 0; i < nchilds; i++) { el = (GdomeElement *)gdome_nl_item (childs, i, &exc); if (el == NULL) { fprintf (stderr, "NodeList.item(%d): NULL\n\tException #%d\n", (int)i, exc); return 1; } if (gdome_el_nodeType (el, &exc) == GDOME_ELEMENT_NODE) { gdome_el_setAttribute (el, name, value, &exc); if (exc) { fprintf (stderr, "Element.setAttribute: failed\n\tException #%d\n", exc); return 1; } } gdome_el_unref (el, &exc); } gdome_nl_unref (childs, &exc); gdome_el_unref (root, &exc); /* I save the modified document to a file named "exampleb_out.xml */ if (!gdome_di_saveDocToFile (domimpl, doc, LOCALDIR"/exampleb_out.xml", GDOME_SAVE_STANDARD, &exc)) { fprintf (stderr, "DOMImplementation.saveDocToFile: failed\n\tException #%d\n", exc); return 1; } /* I free the document structure and the DOMImplementation */ gdome_doc_unref (doc, &exc); gdome_di_unref (domimpl, &exc); return 0; } gdome2-0.8.1/test/examplec.c0000664000076400007640000000620407372166422011324 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* examplec.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include int isSpaceStr (GdomeDOMString *domstr) { gchar *str = domstr->str; for (; *str; str++) if (!isspace(*str)) return 0; return 1; } void cleanSubTree (GdomeNode *node) { GdomeNode *child = NULL, *dchild = NULL; GdomeNodeList *nl = NULL; GdomeException exc; GdomeDOMString *str; long i, nllength; nl = gdome_n_childNodes (node, &exc); if ((nllength = gdome_nl_length (nl, &exc)) == 0) { if (nl != NULL) gdome_nl_unref (nl, &exc); return; } for (i = nllength-1; i >= 0; i--) { child = gdome_nl_item (nl, i, &exc); str = NULL; if (gdome_n_nodeType (child, &exc) == GDOME_COMMENT_NODE || (gdome_n_nodeType (child, &exc) == GDOME_TEXT_NODE && isSpaceStr ((str = gdome_t_data ((GdomeText *)child, &exc))))) { dchild = gdome_n_removeChild (node, child, &exc); if (str != NULL) gdome_str_unref (str); if (dchild != NULL) gdome_n_unref (dchild, &exc); } else if (gdome_n_hasChildNodes (child, &exc)) cleanSubTree (child); if (child != NULL) gdome_n_unref (child, &exc); } if (nl != NULL) gdome_nl_unref (nl, &exc); } int main (int argc, char **argv) { GdomeDOMImplementation *domimpl; GdomeDocument *doc; GdomeElement *rootel; GdomeException exc; /* First I get a DOMImplementation reference */ domimpl = gdome_di_mkref (); /* I load a new document from the file name "exampleb.xml */ doc = gdome_di_createDocFromURI(domimpl, LOCALDIR"/examplec.xml", GDOME_LOAD_PARSING, &exc); if (doc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromURI: failed\n\tException #%d\n", exc); return 1; } /* I get reference to the root element of the document */ rootel = gdome_doc_documentElement (doc, &exc); if (rootel == NULL) { fprintf (stderr, "Document.documentElement: NULL\n\tException #%d\n", exc); return 1; } cleanSubTree ((GdomeNode *)rootel); gdome_el_unref (rootel, &exc); if (!gdome_di_saveDocToFile (domimpl, doc, LOCALDIR"/examplec_out.xml", GDOME_SAVE_STANDARD, &exc)) { fprintf (stderr, "DOMImplementation.saveDocToFile: failed\n\tException #%d\n", exc); return 1; } /* I free the document structure and the DOMImplementation */ gdome_doc_unref (doc, &exc); gdome_di_unref (domimpl, &exc); return 0; } gdome2-0.8.1/test/test-mevents.c0000664000076400007640000002745407705723250012174 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* test-mevents.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include char prop[128]; void signprop (const char *str) { strcat (prop, str); } void resetprop () { prop[0] = '\0'; } void callback (GdomeEventListener *self, GdomeEvent *event, GdomeException *exc) { GdomeNode *ct = gdome_mevnt_currentTarget ((GdomeMutationEvent *)event, exc); GdomeDOMString *attrName, *id; if (ct != NULL && gdome_n_nodeType (ct, exc) == GDOME_ELEMENT_NODE) { attrName = gdome_str_mkref ("ITEM"); id = gdome_el_getAttribute ((GdomeElement *)ct, attrName, exc); gdome_str_unref (attrName); signprop (id->str); gdome_str_unref (id); } else signprop (" "); gdome_n_unref (ct, exc); } void dot() { printf("."); fflush(stdout); } gboolean test_mevents (GdomeDocument *doc) { GdomeException exc; GdomeElement *els[6], *el1, *el2; GdomeEventListener *evl; GdomeDOMString *id, *evntType, *str, *attrValue; GdomeNode *result; GdomeAttr *attr; GdomeText *txt; gchar buff[2]; gboolean ret = TRUE; int i; buff[1] = '\0'; evl = gdome_evntl_mkref (callback, NULL); /* Get els refs */ for (i=0; i<6 && ret; i++) { buff[0]='0'+i; id = gdome_str_mkref_dup (buff); els[i] = gdome_doc_getElementById (doc, id, &exc); if (els[i] == NULL) fprintf (stderr, "\nDocument.getElementById(\"%s\"), NULL", buff), ret = FALSE; gdome_str_unref (id); } dot(); /* Setting capture listeners */ evntType = gdome_str_mkref("DOMNodeInserted"); for (i=0; i<6; i++) gdome_el_addEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMNodeInsertedIntoDocument"); for (i=0; i<6; i++) gdome_el_addEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMNodeRemoved"); for (i=0; i<6; i++) gdome_el_addEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMNodeRemovedFromDocument"); for (i=0; i<6; i++) gdome_el_addEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMSubtreeModified"); for (i=0; i<6; i++) gdome_el_addEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMAttrModified"); for (i=0; i<6; i++) gdome_el_addEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMCharacterDataModified"); for (i=0; i<6; i++) gdome_el_addEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); dot(); /* DOMCharacterDataModified Test 1 */ txt = (GdomeText *)gdome_el_firstChild (els[3], &exc); str = gdome_str_mkref ("Changed Test String"); gdome_t_set_data (txt, str, &exc); gdome_str_unref (str); gdome_t_unref (txt, &exc); if (strcmp (prop, "0123012")) fprintf (stderr, "\n DOMCharacterDataModified Test 1 , failed"), ret = FALSE; resetprop(); dot(); /* DOMNodeInserted Test 1 */ str = gdome_str_mkref ("WOW"); txt = gdome_doc_createTextNode (doc, str, &exc); result = gdome_el_appendChild (els[2], (GdomeNode *)txt, &exc); gdome_n_unref (result, &exc); gdome_t_unref (txt, &exc); gdome_str_unref (str); if (strcmp (prop, "01201201")) fprintf (stderr, "\n DOMNodeInserted Test 1 , failed"), ret = FALSE; resetprop(); dot(); /* DOMNodeInserted Test 2 */ str = gdome_str_mkref ("WOW"); txt = gdome_doc_createTextNode (doc, str, &exc); gdome_str_unref (str); str = gdome_str_mkref ("NEWEL"); el1 = gdome_doc_createElement (doc, str, &exc); gdome_str_unref (str); result = gdome_el_appendChild (el1, (GdomeNode *)txt, &exc); gdome_n_unref (result, &exc); gdome_t_unref (txt, &exc); result = gdome_el_appendChild (els[1], (GdomeNode *)el1, &exc); gdome_n_unref (result, &exc); gdome_el_unref (el1, &exc); if (strcmp (prop, "0101010")) fprintf (stderr, "\n DOMNodeInserted Test 2 , failed"), ret = FALSE; resetprop(); dot(); /* DOMNodeInserted Test 3 */ str = gdome_str_mkref ("WOW"); txt = gdome_doc_createTextNode (doc, str, &exc); gdome_str_unref (str); str = gdome_str_mkref ("NEWEL"); el1 = gdome_doc_createElement (doc, str, &exc); el2 = gdome_doc_createElement (doc, str, &exc); gdome_str_unref (str); result = gdome_el_appendChild (el2, (GdomeNode *)txt, &exc); gdome_n_unref (result, &exc); gdome_t_unref (txt, &exc); str = gdome_str_mkref ("ITEM"); attrValue = gdome_str_mkref ("a"); gdome_el_setAttribute (el1, str, attrValue, &exc); gdome_str_unref (attrValue); attrValue = gdome_str_mkref ("b"); gdome_el_setAttribute (el2, str, attrValue, &exc); gdome_str_unref (attrValue); gdome_str_unref (str); result = gdome_el_appendChild (el1, (GdomeNode *)el2, &exc); gdome_n_unref (result, &exc); evntType = gdome_str_mkref("DOMNodeInserted"); gdome_el_addEventListener (el1, evntType, evl, TRUE, &exc); gdome_el_addEventListener (el2, evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMNodeInsertedIntoDocument"); gdome_el_addEventListener (el1, evntType, evl, TRUE, &exc); gdome_el_addEventListener (el2, evntType, evl, TRUE, &exc); gdome_str_unref (evntType); result = gdome_el_appendChild (els[3], (GdomeNode *)el1, &exc); gdome_n_unref (result, &exc); evntType = gdome_str_mkref("DOMNodeInserted"); gdome_el_removeEventListener (el1, evntType, evl, TRUE, &exc); gdome_el_removeEventListener (el2, evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMNodeInsertedIntoDocument"); gdome_el_removeEventListener (el1, evntType, evl, TRUE, &exc); gdome_el_removeEventListener (el2, evntType, evl, TRUE, &exc); gdome_str_unref (evntType); gdome_el_unref (el2, &exc); gdome_el_unref (el1, &exc); if (strcmp (prop, "012301230123a0123ab012")) fprintf (stderr, "\n DOMNodeInserted Test 3 , failed"), ret = FALSE; resetprop(); dot(); /* DOMNodeRemoved Test 1 */ txt = (GdomeText *)gdome_el_lastChild (els[2], &exc); result = gdome_el_removeChild (els[2], (GdomeNode *)txt, &exc); gdome_n_unref (result, &exc); gdome_t_unref (txt, &exc); if (strcmp (prop, "01201201")) fprintf (stderr, "\n DOMNodeRemoved Test 1 , failed"), ret = FALSE; resetprop(); dot(); /* DOMNodeRemoved Test 2 */ el1 = (GdomeElement *)gdome_el_lastChild (els[1], &exc); txt = (GdomeText *)gdome_el_lastChild (el1, &exc); result = gdome_el_removeChild (els[1], (GdomeNode *)el1, &exc); gdome_n_unref (result, &exc); gdome_t_unref (txt, &exc); gdome_el_unref (el1, &exc); if (strcmp (prop, "0101010")) fprintf (stderr, "\n DOMNodeRemoved Test 2 , failed"), ret = FALSE; resetprop(); dot(); /* DOMNodeRemoved Test 3 */ el1 = (GdomeElement *)gdome_el_lastChild (els[3], &exc); el2 = (GdomeElement *)gdome_el_lastChild (el1, &exc); evntType = gdome_str_mkref("DOMNodeRemoved"); gdome_el_addEventListener (el1, evntType, evl, TRUE, &exc); gdome_el_addEventListener (el2, evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMNodeRemovedFromDocument"); gdome_el_addEventListener (el1, evntType, evl, TRUE, &exc); gdome_el_addEventListener (el2, evntType, evl, TRUE, &exc); gdome_str_unref (evntType); result = gdome_el_removeChild (els[3], (GdomeNode *)el1, &exc); gdome_n_unref (result, &exc); evntType = gdome_str_mkref("DOMNodeRemoved"); gdome_el_removeEventListener (el1, evntType, evl, TRUE, &exc); gdome_el_removeEventListener (el2, evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMNodeRemovedFromDocument"); gdome_el_removeEventListener (el1, evntType, evl, TRUE, &exc); gdome_el_removeEventListener (el2, evntType, evl, TRUE, &exc); gdome_str_unref (evntType); gdome_el_unref (el2, &exc); gdome_el_unref (el1, &exc); if (strcmp (prop, "012301230123a0123ab012")) fprintf (stderr, "\n DOMNodeRemoved Test 3 , failed"), ret = FALSE; resetprop(); dot(); /* DOMAttrModified ADDITION */ str = gdome_str_mkref ("ATTR"); attrValue = gdome_str_mkref ("attrValue"); attr = gdome_doc_createAttribute (doc, str, &exc); gdome_a_set_value (attr, attrValue, &exc); gdome_str_unref (attrValue); gdome_str_unref (str); gdome_el_setAttributeNode (els[3], attr, &exc); if (strcmp (prop, "012012")) fprintf (stderr, "\n DOMAttrModified ADDITION , failed"), ret = FALSE; resetprop(); dot(); /* DOMAttrModified MODIFICATION */ attrValue = gdome_str_mkref ("attrNewValue"); gdome_a_set_value (attr, attrValue, &exc); gdome_str_unref (attrValue); gdome_a_unref (attr, &exc); if (strcmp (prop, "012012")) fprintf (stderr, "\n DOMAttrModified MODIFICATION , failed"), ret = FALSE; resetprop(); dot(); /* DOMAttrModified REMOVAL */ str = gdome_str_mkref ("attr"); gdome_el_removeAttribute (els[3], str, &exc); gdome_str_unref (str); str = gdome_str_mkref ("ATTR"); gdome_el_removeAttribute (els[3], str, &exc); gdome_str_unref (str); if (strcmp (prop, "012012")) fprintf (stderr, "\n DOMAttrModified REMOVAL , failed"), ret = FALSE; resetprop(); dot(); /* Remove capture listeners */ evntType = gdome_str_mkref("DOMNodeInserted"); for (i=0; i<6; i++) gdome_el_removeEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMNodeInsertedIntoDocument"); for (i=0; i<6; i++) gdome_el_removeEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMNodeRemoved"); for (i=0; i<6; i++) gdome_el_removeEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMNodeRemovedFromDocument"); for (i=0; i<6; i++) gdome_el_removeEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMSubtreeModified"); for (i=0; i<6; i++) gdome_el_removeEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMAttrModified"); for (i=0; i<6; i++) gdome_el_removeEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); evntType = gdome_str_mkref("DOMCharacterDataModified"); for (i=0; i<6; i++) gdome_el_removeEventListener (els[i], evntType, evl, TRUE, &exc); gdome_str_unref (evntType); dot(); for (i=0; i<6; i++) gdome_el_unref (els[i], &exc); gdome_evntl_unref (evl, &exc); printf ("test_mevents\n"); return ret; } int main (int argc, char **argv) { GdomeDOMImplementation *domImpl = NULL; GdomeDocument *domdoc = NULL; GdomeException exc = 0; gboolean ret = FALSE; domImpl = gdome_di_mkref(); domdoc = gdome_di_createDocFromURI (domImpl, LOCALDIR"/test-mevents.xml", GDOME_LOAD_PARSING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOImplementation.createDocFromURI: failed\n test-mevents.xml not found\n"); return -1; } ret = test_mevents(domdoc); gdome_doc_unref(domdoc, &exc); if(ret) return 0; else return -1; } gdome2-0.8.1/test/test-loadsave.c0000664000076400007640000001637207473207316012310 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* test-loadsave.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include char buffer1[] = "\n" "\n" " \n" " \n" " \n" "]>\n" "\n" " \n" " \n" " \n" " zero\n" " one\n" " \n" " two\n" " \n" " \n" " three\n" " \n" " \n" " \n" " four\n" " five\n" " \n" " \n" " \n" " \n" " six\n" " seven\n" " \n" " eight\n" " \n" " \n" "\n"; char buffer2[] = "\n" "\n" " \n" "]>\n" "\n" " Ų\n" " &foo;\n" " ⇅\n" "\n"; const GdomeEntitiesTableEntry entityTable[] = { { "UnderBar", "\xcc\xb2\x00", NULL, NULL }, { "UnderBrace", "\xef\xb8\xb8\x00", NULL, NULL }, { "UnderBracket", "\xe2\x8e\xb5\x00", NULL, NULL }, { "UnderParenthesis", "\xef\xb8\xb6\x00", NULL, NULL }, { "Union", "\xe2\x8b\x83\x00", NULL, NULL }, { "UnionPlus", "\xe2\x8a\x8e\x00", NULL, NULL }, { "uogon", "\xc5\xb3\x00", NULL, NULL }, { "Uogon", "\xc5\xb2\x00", NULL, NULL }, { "uopf", "\xf0\x9d\x95\xa6\x00", NULL, NULL }, { "Uopf", "\xf0\x9d\x95\x8c\x00", NULL, NULL }, { "uparrow", "\xe2\x86\x91\x00", NULL, NULL }, { "Uparrow", "\xe2\x87\x91\x00", NULL, NULL }, { "UpArrow", "\xe2\x86\x91\x00", NULL, NULL }, { "UpArrowBar", "\xe2\xa4\x92\x00", NULL, NULL }, { "UpArrowDownArrow", "\xe2\x87\x85\x00", NULL, NULL }, { NULL, NULL, NULL, NULL}}; void dot() { printf("."); fflush(stdout); } int main (int argc, char **argv) { GdomeDOMImplementation *domImpl = NULL; GdomeDocument *domdoc = NULL; GdomeException exc = 0; char *mem; domImpl = gdome_di_mkref(); domdoc = gdome_di_createDocFromURI (domImpl, LOCALDIR"/test-document2.xml", GDOME_LOAD_PARSING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromURI: parsing failed\n test-document2.xml not found\n"); return -1; } gdome_doc_unref(domdoc, &exc); dot(); domdoc = gdome_di_createDocFromURI (domImpl, LOCALDIR"/test-document2.xml", GDOME_LOAD_PARSING | GDOME_LOAD_SUBSTITUTE_ENTITIES, &exc); if (domdoc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromURI: parsing with substitution failed\n test-document2.xml not found\n"); return -1; } gdome_doc_unref(domdoc, &exc); dot(); domdoc = gdome_di_createDocFromURI (domImpl, LOCALDIR"/test-loadsave1.xml", GDOME_LOAD_VALIDATING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromURI: validating failed\n test-loadsave1.xml not found\n"); return -1; } gdome_doc_unref(domdoc, &exc); dot(); domdoc = gdome_di_createDocFromMemory (domImpl, buffer1, GDOME_LOAD_PARSING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromMemory: parsing failed\n"); return -1; } if (!gdome_di_saveDocToMemory (domImpl, domdoc, &mem, 0, &exc)) { fprintf (stderr, "DOMImplementation.saveDocToMemory: failed\n"); return -1; } free (mem); if (!gdome_di_saveDocToMemoryEnc (domImpl, domdoc, &mem, "ISO-8859-1", 0, &exc)) { fprintf (stderr, "DOMImplementation.saveDocToMemory: failed\n"); return -1; } free (mem); gdome_doc_unref(domdoc, &exc); dot(); domdoc = gdome_di_createDocFromMemory (domImpl, buffer1, GDOME_LOAD_VALIDATING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromMemory: validating failed\n"); return -1; } gdome_doc_unref(domdoc, &exc); dot(); domdoc = gdome_di_createDocFromURIWithEntitiesTable (domImpl, LOCALDIR"/test-loadsave2.xml", entityTable, GDOME_LOAD_PARSING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromURIWithEntityTable: parsing failed\n test-loadsave2.xml not found\n"); return -1; } gdome_doc_unref(domdoc, &exc); dot(); domdoc = gdome_di_createDocFromURIWithEntitiesTable (domImpl, LOCALDIR"/test-loadsave2.xml", entityTable, GDOME_LOAD_PARSING | GDOME_LOAD_SUBSTITUTE_ENTITIES, &exc); if (domdoc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromURIWithEntityTable: parsing with substitution failed\n test-loadsave2.xml not found\n"); return -1; } gdome_doc_unref(domdoc, &exc); dot(); domdoc = gdome_di_createDocFromURIWithEntitiesTable (domImpl, LOCALDIR"/test-loadsave1.xml", entityTable, GDOME_LOAD_VALIDATING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromURIWithEntityTable: validating failed\n test-loadsave2.xml not found\n"); return -1; } gdome_doc_unref(domdoc, &exc); dot(); domdoc = gdome_di_createDocFromMemoryWithEntitiesTable (domImpl, buffer2, entityTable, GDOME_LOAD_PARSING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromMemoryWithEntityTable: parsing failed\n"); return -1; } gdome_doc_unref(domdoc, &exc); dot(); domdoc = gdome_di_createDocFromMemoryWithEntitiesTable (domImpl, buffer2, entityTable, GDOME_LOAD_VALIDATING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromMemoryWithEntityTable: validating failed\n"); return -1; } gdome_doc_unref(domdoc, &exc); dot(); printf("test_loadsave\n"); return 0; } gdome2-0.8.1/test/test-str.c0000664000076400007640000000616007311512651011304 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* test-str.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include void dot() { printf("."); fflush(stdout); } int main (int argc, char **argv) { GdomeDOMString *str1, *str2, *str3, *str4; gboolean ret = TRUE; int i; /* Test equal */ str1 = gdome_str_mkref ("Test String"); str2 = gdome_str_mkref ("Test String"); if (!gdome_str_equal (str1, str2) || !gdome_str_equal (str2, str1)) fprintf (stderr, "\nDOMString.equal: failed"), ret = FALSE; gdome_str_unref (str2); dot(); /* Test equalIgnoreCase */ str2 = gdome_str_mkref ("test string"); if (!gdome_str_equalIgnoreCase (str1, str2) || !gdome_str_equalIgnoreCase (str2, str1)) fprintf (stderr, "\nDOMString.equalIgnoreCase: failed"), ret = FALSE; gdome_str_unref (str2); dot(); /* Test charAt */ for (i=0; istr) && ret; i++) if (gdome_str_charAt (str1, i) != str1->str[i]) fprintf (stderr, "\nDOMString.charAt(%d): failed", i), ret = FALSE; dot(); /* Text concat */ str2 = gdome_str_mkref (" Test String"); str3 = gdome_str_concat (str1, str2); str4 = gdome_str_mkref ("Test String Test String"); if (!gdome_str_equal (str3, str4)) fprintf (stderr, "\nDOMString.concat: failed"), ret = FALSE; gdome_str_unref (str2); gdome_str_unref (str3); gdome_str_unref (str4); dot(); /* Test endsWith */ str2 = gdome_str_mkref ("ring"); str3 = gdome_str_mkref ("rin"); if (!gdome_str_endsWith (str1, str2) || !gdome_str_endsWith (str1, NULL) || gdome_str_endsWith (str1, str3)) fprintf (stderr, "\nDOMString.endsWith: failed"), ret = FALSE; gdome_str_unref (str2); gdome_str_unref (str3); dot(); /* Test length */ if (gdome_str_length (str1) != strlen (str1->str)) fprintf (stderr, "\nDOMString.length: failed"), ret = FALSE; dot(); /* Test startsWith */ str2 = gdome_str_mkref ("Test"); str3 = gdome_str_mkref ("est"); if (!gdome_str_startsWith (str1, str2) || !gdome_str_startsWith (str1, NULL) || gdome_str_startsWith (str1, str3)) fprintf (stderr, "\nDOMString.startsWith: failed"), ret = FALSE; gdome_str_unref (str2); gdome_str_unref (str3); gdome_str_unref (str1); dot(); printf ("test_str\n"); if (ret) return 0; else return -1; } gdome2-0.8.1/test/test-treegc.c0000664000076400007640000002232407705723250011753 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* test-treegc.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include void dot() { printf("."); fflush(stdout); } /** * test_treegc1 * @domImpl The DOM implementation * * Returns TRUE if gdome_n_removeChild works fine with w.r.t. treegc. */ gboolean test_treegc1(GdomeDOMImplementation *domImpl) { GdomeDocument *doc; GdomeNodeList *nl = NULL; GdomeNode *node1 = NULL, *node2 = NULL; GdomeAttr *attr = NULL; GdomeText *text = NULL; GdomeDOMString *name = NULL; GdomeException exc; gboolean ret = TRUE; doc = gdome_di_createDocFromURI(domImpl, LOCALDIR"/test-treegc.xml", GDOME_LOAD_PARSING, &exc); if (doc == NULL) fprintf (stderr, "DOImplementation.createDocFromURI: failed\n test-treegc.xml not found\n"), ret = FALSE; else { dot(); name = gdome_str_mkref ("TOTEST"); nl = gdome_doc_getElementsByTagName (doc, name, &exc); gdome_str_unref (name); node1 = gdome_nl_item (nl, 0L, &exc); gdome_nl_unref (nl, &exc); if (gdome_treegc_livenodes (node1) != 2) fprintf (stderr, "\nLivenodes check 1: Failed"), ret = FALSE; else { dot(); node2 = gdome_n_firstChild (node1, &exc); if (gdome_treegc_livenodes (node2) != 3) fprintf (stderr, "\nLivenodes check 2: Failed"), ret = FALSE; else { dot(); name = gdome_str_mkref ("ATTR"); attr = gdome_el_getAttributeNode ((GdomeElement *)node2, name, &exc); gdome_str_unref (name); if (gdome_treegc_livenodes ((GdomeNode *)attr) != 4) fprintf (stderr, "\nLivenodes check 3: Failed"), ret = FALSE; else { dot(); text = (GdomeText *)gdome_a_firstChild (attr, &exc); if (gdome_treegc_livenodes ((GdomeNode *)text) != 5) fprintf (stderr, "\nLivenodes check 4: Failed"), ret = FALSE; else { dot(); node2 = gdome_n_removeChild (node1, node2, &exc); if (gdome_treegc_livenodes ((GdomeNode *)doc) != 5) fprintf (stderr, "\nLivenodes check 5: Failed"), ret = FALSE; else { dot(); gdome_n_unref (node1, &exc); if (gdome_treegc_livenodes ((GdomeNode *)doc) != 4) fprintf (stderr, "\nLivenodes check 6: Failed"), ret = FALSE; else { dot(); gdome_n_unref (node2, &exc); if (gdome_treegc_livenodes ((GdomeNode *)doc) != 4) fprintf (stderr, "\nLivenodes check 7: Failed"), ret = FALSE; else { dot(); gdome_n_unref (node2, &exc); if (gdome_treegc_livenodes ((GdomeNode *)doc) != 1) fprintf (stderr, "\nLivenodes check 8: Failed"), ret = FALSE; else { dot(); gdome_a_unref (attr, &exc); if (gdome_treegc_livenodes ((GdomeNode *)doc) != 1) fprintf (stderr, "\nLivenodes check 9: Failed"), ret = FALSE; else { dot(); gdome_t_unref (text, &exc); if (gdome_treegc_livenodes ((GdomeNode *)doc) != 1) fprintf (stderr, "\nLivenodes check 10: Failed"), ret = FALSE; else { dot(); gdome_doc_unref (doc, &exc); } } } } } } } } } } } printf ("test_treegc1\n"); return ret; } /** * test_treegc2 * @domImpl The DOM implementation * * Returns TRUE if gdome_n_cloneNode and gdome_n_appendChild works fine with * w.r.t. treegc. */ gboolean test_treegc2(GdomeDOMImplementation *domImpl) { GdomeDocument *doc; GdomeNodeList *nl = NULL; GdomeNode *node1 = NULL, *node2 = NULL, *node3 = NULL, *node4 = NULL; GdomeAttr *attr = NULL; GdomeText *text = NULL; GdomeDOMString *name = NULL; GdomeException exc; gboolean ret = TRUE; doc = gdome_di_createDocFromURI(domImpl, LOCALDIR"/test-treegc.xml", GDOME_LOAD_PARSING, &exc); if (doc == NULL) fprintf (stderr, "DOImplementation.createDocFromURI: failed\n test-treegc.xml not found\n"), ret = FALSE; else { dot(); name = gdome_str_mkref ("TOTEST"); nl = gdome_doc_getElementsByTagName (doc, name, &exc); gdome_str_unref (name); node1 = gdome_nl_item (nl, 0L, &exc); gdome_nl_unref (nl, &exc); if (gdome_treegc_livenodes (node1) != 2) fprintf (stderr, "\nLivenodes check 1: Failed"), ret = FALSE; else { dot(); node2 = gdome_n_firstChild (node1, &exc); if (gdome_treegc_livenodes (node2) != 3) fprintf (stderr, "\nLivenodes check 2: Failed"), ret = FALSE; else { dot(); name = gdome_str_mkref ("ATTR"); attr = gdome_el_getAttributeNode ((GdomeElement *)node2, name, &exc); gdome_str_unref (name); if (gdome_treegc_livenodes ((GdomeNode *)attr) != 4) fprintf (stderr, "\nLivenodes check 3: Failed"), ret = FALSE; else { dot(); text = (GdomeText *)gdome_a_firstChild (attr, &exc); if (gdome_treegc_livenodes ((GdomeNode *)text) != 5) fprintf (stderr, "\nLivenodes check 4: Failed"), ret = FALSE; else { dot(); node3 = gdome_n_cloneNode (node2, TRUE, &exc); if (gdome_treegc_livenodes ((GdomeNode *)doc) != 6) fprintf (stderr, "\nLivenodes check 5: Failed"), ret = FALSE; else { dot(); node3 = gdome_n_appendChild (node1, node3, &exc); node4 = gdome_n_cloneNode (node2, TRUE, &exc); if (gdome_treegc_livenodes ((GdomeNode *)doc) != 7) fprintf (stderr, "\nLivenodes check 6: Failed"), ret = FALSE; else { dot(); node4 = gdome_n_insertBefore (node1, node4, node3, &exc); if (gdome_treegc_livenodes ((GdomeNode *)doc) != 7) fprintf (stderr, "\nLivenodes check 7: Failed"), ret = FALSE; else { dot(); gdome_n_unref (node4, &exc); gdome_n_unref (node4, &exc); gdome_n_unref (node3, &exc); gdome_n_unref (node3, &exc); gdome_n_unref (node2, &exc); gdome_a_unref (attr, &exc); gdome_t_unref (text, &exc); gdome_n_unref (node1, &exc); if (gdome_treegc_livenodes ((GdomeNode *)doc) != 1) fprintf (stderr, "\nLivenodes check 8 %d: Failed",gdome_treegc_livenodes ((GdomeNode *)doc)), ret = FALSE; else { dot(); gdome_doc_unref (doc, &exc); } } } } } } } } } printf ("test_treegc2\n"); return ret; } int main (int argc, char **argv) { GdomeDOMImplementation *domImpl = NULL; GdomeDocument *doc = NULL; GdomeDocumentType *dt = NULL; GdomeDOMString *dtname, *pID, *sID, *name; GdomeElement *root; GdomeException exc = 0; gboolean ret = FALSE; domImpl = gdome_di_mkref(); /* Test for DocumentType Node not owned by a Document */ dtname = gdome_str_mkref ("TEST"); pID = gdome_str_mkref ("http://www.w3c.org/test.dtd"); sID = gdome_str_mkref ("test.dtd"); dt = gdome_di_createDocumentType (domImpl, dtname, pID, sID, &exc); gdome_str_unref (dtname); gdome_str_unref (pID); gdome_str_unref (sID); gdome_dt_unref (dt, &exc); /* Test for simple Document creation */ name = gdome_str_mkref ("TEST"); doc = gdome_di_createDocument(domImpl, NULL, name, NULL, &exc); gdome_str_unref (name); root = gdome_doc_documentElement (doc, &exc); gdome_doc_unref (doc, &exc); gdome_el_unref (root, &exc); /* Test for Document creation with a DocumentType Node */ dtname = gdome_str_mkref ("TEST"); pID = gdome_str_mkref ("http://www.w3c.org/test.dtd"); sID = gdome_str_mkref ("test.dtd"); dt = gdome_di_createDocumentType (domImpl, dtname, pID, sID, &exc); gdome_str_unref (dtname); gdome_str_unref (pID); gdome_str_unref (sID); name = gdome_str_mkref ("TEST"); doc = gdome_di_createDocument(domImpl, NULL, name, NULL, &exc); gdome_str_unref (name); root = gdome_doc_documentElement (doc, &exc); gdome_doc_unref (doc, &exc); gdome_el_unref (root, &exc); gdome_dt_unref (dt, &exc); ret = test_treegc1(domImpl); ret = test_treegc2(domImpl); if(ret) return 0; else return -1; } gdome2-0.8.1/test/test-xpath.c0000664000076400007640000002207207541001710011612 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* test-xpath.c * * Copyright (C) 2002 T.J. Mather * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #define LBUFFER 256 #include #include #include #include #include #include void dot() { printf("."); fflush(stdout); } gboolean test_xpath (GdomeDocument *doc) { GdomeException exc = 0; GdomeDOMString *str, *temp_str; GdomeNode *gnode; GdomeXPathEvaluator *eval = NULL; GdomeXPathResult *res = NULL; GdomeElement *ns_el = NULL; GdomeXPathNSResolver *nsresolv = NULL; unsigned short result_type; double number_value; GdomeDOMString *string_value; GdomeBoolean boolean_value; gboolean ret = TRUE; eval = gdome_xpeval_mkref(); str = gdome_str_mkref("//p"); res = gdome_xpeval_evaluate(eval, str, (GdomeNode *)doc, NULL, 0, NULL, &exc); gnode = gdome_xpresult_singleNodeValue(res, &exc); temp_str = gdome_el_tagName((GdomeElement *)gnode, &exc); if (strcmp (temp_str->str, "p")) fprintf(stderr,"\n1st xpath result tagName, %s != p",temp_str->str), ret = FALSE; gdome_n_unref(gnode, &exc); gdome_str_unref(str); gdome_str_unref(temp_str); dot(); gnode = gdome_xpresult_iterateNext(res, &exc); temp_str = gdome_el_tagName((GdomeElement *)gnode, &exc); if (strcmp (temp_str->str, "p")) fprintf(stderr,"\n1st xpath result tagName, %s != p",temp_str->str), ret = FALSE; gdome_n_unref(gnode, &exc); gdome_str_unref(temp_str); dot(); gnode = gdome_xpresult_iterateNext(res, &exc); temp_str = gdome_el_tagName((GdomeElement *)gnode, &exc); if (strcmp (temp_str->str, "p")) fprintf(stderr,"\n2nd xpath result tagName, %s != p",temp_str->str), ret = FALSE; gdome_n_unref(gnode, &exc); gdome_str_unref(temp_str); dot(); gnode = gdome_xpresult_iterateNext(res, &exc); if (gnode != NULL) fprintf(stderr,"\n3nd xpath result received, none expected"), ret = FALSE; gdome_n_unref(gnode, &exc); dot(); /* Test XPath expression that doesn't return anything */ str = gdome_str_mkref("//q"); res = gdome_xpeval_evaluate(eval, str, (GdomeNode *)doc, NULL, 0, NULL, &exc); gnode = gdome_xpresult_singleNodeValue(res, &exc); if (gnode != NULL) fprintf(stderr,"\n1st xpath result != NULL"), ret = FALSE; gdome_str_unref(str); dot(); gnode = gdome_xpresult_iterateNext(res, &exc); if (gnode != NULL) fprintf(stderr,"\n1st xpath result != NULL"), ret = FALSE; dot(); gdome_xpresult_unref(res, &exc); ns_el = gdome_doc_documentElement(doc, &exc); nsresolv = gdome_xpeval_createNSResolver(eval, (GdomeNode *) ns_el, &exc); str = gdome_str_mkref("//foo:bar/*"); res = gdome_xpeval_evaluate(eval, str, (GdomeNode *)doc, nsresolv, 0, NULL, &exc); result_type = gdome_xpresult_resultType(res, &exc); if (result_type != GDOME_ORDERED_NODE_ITERATOR_TYPE) fprintf(stderr,"\nResult type not node set, got %d",result_type), ret = FALSE; dot(); gnode = gdome_xpresult_iterateNext(res, &exc); temp_str = gdome_el_tagName((GdomeElement *)gnode, &exc); if (strcmp (temp_str->str, "foo:a1")) fprintf(stderr,"\n1st xpath result tagName, %s != foo:a1",temp_str->str), ret = FALSE; gdome_n_unref(gnode, &exc); gdome_el_unref(ns_el, &exc); gdome_str_unref(temp_str); gdome_str_unref(str); gdome_xpnsresolv_unref(nsresolv, &exc); dot(); gnode = gdome_xpresult_iterateNext(res, &exc); temp_str = gdome_el_tagName((GdomeElement *)gnode, &exc); if (strcmp (temp_str->str, "foo:a2")) fprintf(stderr,"\n2nd xpath result tagName, %s != foo:a2",temp_str->str), ret = FALSE; gdome_n_unref(gnode, &exc); gdome_str_unref(temp_str); gdome_xpresult_unref(res, &exc); dot(); str = gdome_str_mkref("count(//p)"); res = gdome_xpeval_evaluate(eval, str, (GdomeNode *)doc, NULL, 0, NULL, &exc); result_type = gdome_xpresult_resultType(res, &exc); if (result_type != GDOME_NUMBER_TYPE) fprintf(stderr,"\nResult type not number, got %d",result_type), ret = FALSE; dot(); number_value = gdome_xpresult_numberValue(res, &exc); if (number_value != 2) fprintf(stderr,"\nResult set count != 1, got %f",number_value), ret = FALSE; dot(); gdome_xpresult_unref(res, &exc); gdome_str_unref(str); str = gdome_str_mkref("concat('abc','def')"); res = gdome_xpeval_evaluate(eval, str, (GdomeNode *)doc, NULL, 0, NULL, &exc); result_type = gdome_xpresult_resultType(res, &exc); if (result_type != GDOME_STRING_TYPE) fprintf(stderr,"\nResult type not string, got %d",result_type), ret = FALSE; dot(); string_value = gdome_xpresult_stringValue(res, &exc); temp_str = gdome_str_mkref("abcdef"); if(!gdome_str_equal(string_value, temp_str)) fprintf(stderr,"\nResult mismatch, %s != %s",string_value->str, temp_str->str), ret = FALSE; dot(); gdome_str_unref(str); gdome_str_unref(temp_str); gdome_str_unref(string_value); gdome_xpresult_unref(res, &exc); str = gdome_str_mkref("true()"); res = gdome_xpeval_evaluate(eval, str, (GdomeNode *)doc, NULL, 0, NULL, &exc); result_type = gdome_xpresult_resultType(res, &exc); if (result_type != GDOME_BOOLEAN_TYPE) fprintf(stderr,"\nResult type not boolean type, got %d",result_type), ret = FALSE; dot(); boolean_value = gdome_xpresult_booleanValue(res, &exc); if(boolean_value != 1) fprintf(stderr,"\nBoolean value != 1, = %d",boolean_value), ret = FALSE; dot(); gdome_str_unref(str); gdome_xpresult_unref(res, &exc); /* test GdomeXPathNamespace interface */ str = gdome_str_mkref("//namespace::*"); res = gdome_xpeval_evaluate(eval, str, (GdomeNode *)doc, NULL, 0, NULL, &exc); gnode = gdome_xpresult_iterateNext(res, &exc); /* nodeType */ result_type = gdome_xpns_nodeType((GdomeXPathNamespace *)gnode, &exc); if (result_type != GDOME_XPATH_NAMESPACE_NODE) fprintf(stderr, "\nresult_type != namespace node, = %d", result_type), ret = FALSE; /* prefix */ temp_str = gdome_xpns_prefix((GdomeXPathNamespace *)gnode, &exc); if (strcmp (temp_str->str, "xml")) fprintf(stderr,"\nnamespace prefix, %s != xml",temp_str->str), ret = FALSE; gdome_str_unref(temp_str); /* nodeName */ temp_str = gdome_xpns_nodeName((GdomeXPathNamespace *)gnode, &exc); if (strcmp (temp_str->str, "xml")) fprintf(stderr,"\nnamespace nodeName, %s != xml",temp_str->str), ret = FALSE; gdome_str_unref(temp_str); /* namespaceURI */ temp_str = gdome_xpns_namespaceURI((GdomeXPathNamespace *)gnode, &exc); if (strcmp (temp_str->str, "http://www.w3.org/XML/1998/namespace")) fprintf(stderr,"\nnamespace URI, %s != http://www.w3.org/XML/1998/namespace",temp_str->str), ret = FALSE; gdome_str_unref(temp_str); gdome_n_unref(gnode, &exc); gnode = gdome_xpresult_iterateNext(res, &exc); /* nodeType */ result_type = gdome_xpns_nodeType((GdomeXPathNamespace *)gnode, &exc); if (result_type != GDOME_XPATH_NAMESPACE_NODE) fprintf(stderr, "\nresult_type != namespace node, = %d", result_type), ret = FALSE; /* prefix */ temp_str = gdome_xpns_prefix((GdomeXPathNamespace *)gnode, &exc); if (strcmp (temp_str->str, "a")) fprintf(stderr,"\nnamespace prefix, %s != a",temp_str->str), ret = FALSE; gdome_str_unref(temp_str); /* nodeName */ temp_str = gdome_xpns_nodeName((GdomeXPathNamespace *)gnode, &exc); if (strcmp (temp_str->str, "a")) fprintf(stderr,"\nnamespace nodeName, %s != a",temp_str->str), ret = FALSE; gdome_str_unref(temp_str); /* namespaceURI */ temp_str = gdome_xpns_namespaceURI((GdomeXPathNamespace *)gnode, &exc); if (strcmp (temp_str->str, "http://www.w3.org")) fprintf(stderr,"\nnamespace URI, %s != http://www.w3.org",temp_str->str), ret = FALSE; gdome_str_unref(temp_str); gdome_n_unref(gnode, &exc); gdome_str_unref(str); gdome_xpresult_unref(res, &exc); gdome_xpeval_unref(eval, &exc); dot(); return ret; } int main (int argc, char **argv) { GdomeDOMImplementation *domImpl = NULL; GdomeDocument *domdoc = NULL; GdomeElement *el = NULL; GdomeException exc = 0; gboolean ret; domImpl = gdome_di_mkref(); domdoc = gdome_di_createDocFromURI (domImpl, LOCALDIR"/test-xpath.xml", GDOME_LOAD_PARSING, &exc); if (domdoc == NULL) { fprintf (stderr, "DOMImplementation.createDocFromUri: failed\n test-xpath.xml not found\n"); return -1; } el = gdome_doc_documentElement (domdoc, &exc); if (el == NULL) { fprintf (stderr, "Document.documentElement: NULL\n"); return -1; } ret = test_xpath(domdoc); gdome_el_unref (el, &exc); gdome_doc_unref (domdoc, &exc); if(ret) return 0; else return -1; } gdome2-0.8.1/test/test-importnode.c0000664000076400007640000000607107475422714012670 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* test-importnode.c * * Copyright (C) 2002 T.J. Mather * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include char buffer1[] = "\n" "\n" "]>\n" "lt"; char buffer2[] = "\n" ""; void dot() { printf("."); fflush(stdout); } int test_importnode (GdomeDocument *domdoc1, GdomeDocument *domdoc2) { GdomeElement *el1, *el2; GdomeText *txt1, *txt2, *txt2a; int exc = 0; el1 = gdome_doc_documentElement (domdoc1, &exc); if (el1 == NULL) { fprintf (stderr, "Document.documentElement: NULL\n"); return 0; } dot(); el2 = gdome_doc_documentElement (domdoc2, &exc); if (el2 == NULL) { fprintf (stderr, "Document.documentElement: NULL\n"); return 0; } dot(); txt1 = (GdomeText *)gdome_el_firstChild (el1, &exc); if (txt1 == NULL) { fprintf (stderr, "Element.firstChild: NULL\n"); return 0; } dot(); txt2 = (GdomeText *)gdome_doc_importNode(domdoc2, (GdomeNode *)txt1, 1, &exc); if (txt2 == NULL) { fprintf (stderr, "Document.importNode: NULL\n"); return 0; } dot(); txt2a = (GdomeText *) gdome_el_appendChild(el2, (GdomeNode *)txt2, &exc); gdome_el_unref(el2, &exc); gdome_el_unref(el1, &exc); gdome_t_unref(txt1, &exc); gdome_t_unref(txt2, &exc); gdome_t_unref(txt2a, &exc); dot(); return 1; } int main (int argc, char **argv) { GdomeDOMImplementation *domImpl = NULL; GdomeDocument *domdoc1 = NULL; GdomeDocument *domdoc2 = NULL; GdomeException exc = 0; gboolean ret; domImpl = gdome_di_mkref(); domdoc1 = gdome_di_createDocFromMemory (domImpl, buffer1, GDOME_LOAD_PARSING, &exc); if (domdoc1 == NULL) { fprintf (stderr, "DOMImplementation.createDocFromMemory: failed\n"); return -1; } domdoc2 = gdome_di_createDocFromMemory (domImpl, buffer2, GDOME_LOAD_PARSING, &exc); if (domdoc2 == NULL) { fprintf (stderr, "DOMImplementation.createDocFromMemory: failed\n"); return -1; } ret = test_importnode(domdoc1,domdoc2); gdome_doc_unref (domdoc1, &exc); gdome_doc_unref (domdoc2, &exc); if(ret) return 0; else return -1; } gdome2-0.8.1/test/bench.c0000664000076400007640000000570707372166422010614 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* bench.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include void printElHead (GdomeElement *el) { GdomeDOMString *str; GdomeException exc; str = gdome_el_tagName (el, &exc); printf("<%s", str->str); gdome_str_unref (str); if (gdome_el_hasAttributes (el, &exc)) { unsigned int i,len; GdomeNamedNodeMap *attrs; GdomeAttr *attr; attrs = gdome_el_attributes (el, &exc); len = gdome_nnm_length (attrs, &exc); for (i = 0; i < len; i++) { attr = (GdomeAttr *)gdome_nnm_item (attrs, i, &exc); str = gdome_a_name (attr, &exc); printf (" %s=", str->str); gdome_str_unref (str); str = gdome_a_value (attr, &exc); printf ("\"%s\"", str->str); gdome_str_unref (str); gdome_a_unref (attr, &exc); } gdome_nnm_unref (attrs, &exc); } printf (">"); } void printElFoot (GdomeElement *el) { GdomeDOMString *str; GdomeException exc; str = gdome_el_tagName (el, &exc); printf("", str->str); gdome_str_unref (str); } void traversal (GdomeElement *el) { GdomeNode *child, *temp; unsigned short type; GdomeDOMString *str; GdomeException exc; child = gdome_el_firstChild (el, &exc); while(child) { type = gdome_n_nodeType (child, &exc); switch (type) { case GDOME_ELEMENT_NODE: printElHead ((GdomeElement *)child); traversal ((GdomeElement *)child); printElFoot ((GdomeElement *)child); break; case GDOME_TEXT_NODE: str = gdome_t_data ((GdomeText *)child, &exc); printf (str->str); gdome_str_unref (str); break; } temp = gdome_n_nextSibling (child, &exc); gdome_n_unref (child, &exc); child = temp; } } int main (int argc, char **argv) { GdomeDOMImplementation *domimpl; GdomeDocument *domdoc; GdomeException exc; if (argc != 2) { fprintf(stderr, "Usage: %s \n", argv[0]); return -1; } domimpl = gdome_di_mkref (); domdoc = gdome_di_createDocFromURI (domimpl, argv[1], GDOME_LOAD_PARSING, &exc); if (domdoc == NULL) { fprintf(stderr, "DOMImplementation.createDocFromURI NULL\n"); return -1; } traversal ((GdomeElement *)domdoc); gdome_di_freeDoc (domimpl, domdoc, &exc); gdome_di_unref (domimpl, &exc); return 0; } gdome2-0.8.1/test/exampleb.xml0000664000076400007640000000012107257377707011705 gdome2-0.8.1/test/examplec.xml0000664000076400007640000000041107265357103011673 gdome2-0.8.1/test/test-document2.xml0000664000076400007640000000127207251124607012754 ]> zero one two three four five six seven eight gdome2-0.8.1/test/test-document3.xml0000664000076400007640000000144207541001736012753 ]> zero one two three four five six seven eight gdome2-0.8.1/test/test-dtd.xml0000664000076400007640000000013507253754154011634 &FOO1; gdome2-0.8.1/test/test-dtd.dtd0000664000076400007640000000053107255162562011605 gdome2-0.8.1/test/test-element.xml0000664000076400007640000000056407436563011012511 ]> gdome2-0.8.1/test/test-node.xml0000664000076400007640000000040407251757321012002 This is a test string This is a node with a namespace This a attributed node gdome2-0.8.1/test/test-nodelist.xml0000664000076400007640000000202207271240046012665 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 gdome2-0.8.1/test/test-namednodemap.xml0000664000076400007640000000217507435532744013520 ]> gdome2-0.8.1/test/test-mevents.xml0000664000076400007640000000046007276336212012537 ]> Test String gdome2-0.8.1/test/test-loadsave1.xml0000664000076400007640000000127207277533612012743 ]> zero one two three four five six seven eight gdome2-0.8.1/test/test-loadsave2.xml0000664000076400007640000000021407277533612012737 ]> Ų &foo; ⇅ gdome2-0.8.1/test/test.xml0000664000076400007640000000021607072636735011066

This is a simple XML document.

Life's a bitch, ain't it?

gdome2-0.8.1/test/test-treegc.xml0000664000076400007640000000021707376142114012324 gdome2-0.8.1/test/test-xpath.xml0000664000076400007640000000037207435536212012203

This is a simple XML document.

Life's a bitch, ain't it?

gdome2-0.8.1/test/apigen/0000777000076400007640000000000007740102244010674 5gdome2-0.8.1/test/apigen/Makefile.in0000664000076400007640000002062607740102244012665 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EXEEXT = @EXEEXT@ GDOME_INCLUDEDIR = @GDOME_INCLUDEDIR@ GDOME_LIBDIR = @GDOME_LIBDIR@ GDOME_LIBS = @GDOME_LIBS@ GDOME_VERSION_INFO = @GDOME_VERSION_INFO@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MIN_VERSION = @GLIB_MIN_VERSION@ GLIB_MKENUMS = @GLIB_MKENUMS@ GLIB_REQUIRED = @GLIB_REQUIRED@ GOBJECT_QUERY = @GOBJECT_QUERY@ HTML_DIR = @HTML_DIR@ LDFLAGS = @LDFLAGS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_MIN_VERSION = @XML_MIN_VERSION@ NULL = INCLUDES = \ -I$(top_srcdir)/libgdome \ $(LIBXML_CFLAGS) $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) noinst_PROGRAMS = \ apigen \ $(NULL) DEPS = $(top_builddir)/libgdome/libgdome.la LDADDS = $(top_builddir)/libgdome/libgdome.la $(LIBXML_LIBS) $(GLIB_LIBS) apigen_SOURCES = \ util.c \ srcutil.c \ apigen.c \ $(NULL) apigen_LDFLAGS = apigen_DEPENDENCIES = $(DEPS) apigen_LDADD = $(LDADDS) EXTRA_DIST = \ util.h \ srcutil.h \ core.xml \ events.xml \ traversal.xml \ xpath.xml \ $(NULL) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../../config.h CONFIG_CLEAN_FILES = noinst_PROGRAMS = apigen$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) -I../.. LIBS = @LIBS@ apigen_OBJECTS = util.$(OBJEXT) srcutil.$(OBJEXT) apigen.$(OBJEXT) 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 = $(apigen_SOURCES) OBJECTS = $(apigen_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj .s $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps test/apigen/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-noinstPROGRAMS: clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) distclean-noinstPROGRAMS: maintainer-clean-noinstPROGRAMS: .c.o: $(COMPILE) -c $< # FIXME: We should only use cygpath when building on Windows, # and only if it is available. .c.obj: $(COMPILE) -c `cygpath -w $<` .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core -rm -f *.$(OBJEXT) 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: apigen$(EXEEXT): $(apigen_OBJECTS) $(apigen_DEPENDENCIES) @rm -f apigen$(EXEEXT) $(LINK) $(apigen_LDFLAGS) $(apigen_OBJECTS) $(apigen_LDADD) $(LIBS) 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 = test/apigen 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-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile $(PROGRAMS) all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: 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-noinstPROGRAMS mostlyclean-compile \ mostlyclean-libtool mostlyclean-tags \ mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-noinstPROGRAMS clean-compile clean-libtool clean-tags \ clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-noinstPROGRAMS distclean-compile \ distclean-libtool distclean-tags distclean-generic \ clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-noinstPROGRAMS \ 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-noinstPROGRAMS distclean-noinstPROGRAMS \ clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ 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 # 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: gdome2-0.8.1/test/apigen/Makefile.am0000664000076400007640000000113007562764212012654 NULL = INCLUDES = \ -I$(top_srcdir)/libgdome \ $(LIBXML_CFLAGS) $(GLIB_CFLAGS) \ -Wall -ansi \ $(NULL) noinst_PROGRAMS = \ apigen \ $(NULL) DEPS = $(top_builddir)/libgdome/libgdome.la LDADDS = $(top_builddir)/libgdome/libgdome.la $(LIBXML_LIBS) $(GLIB_LIBS) apigen_SOURCES = \ util.c \ srcutil.c \ apigen.c \ $(NULL) apigen_LDFLAGS = apigen_DEPENDENCIES = $(DEPS) apigen_LDADD = $(LDADDS) EXTRA_DIST = \ util.h \ srcutil.h \ core.xml \ events.xml \ traversal.xml \ xpath.xml \ $(NULL) gdome2-0.8.1/test/apigen/util.c0000664000076400007640000000532207372166423011747 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* util.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* Certo, capisci, tipo "Aspettando Godot", la parabola dell'attesa estraniata dal suo contesto sociale, come metafora della condizione dell'uomo di fronte al tempo in quanto altro da lui. */ #include #include #include #include "util.h" int isSpaceStr (GdomeDOMString *domstr) { gchar *str = domstr->str; for (; *str; str++) if (!isspace(*str)) return 0; return 1; } void cleanSubTree (GdomeNode *node) { GdomeNode *child = NULL, *dchild = NULL; GdomeNodeList *nl = NULL; GdomeException exc; GdomeDOMString *str; long i, nllength; nl = gdome_n_childNodes (node, &exc); if ((nllength = gdome_nl_length (nl, &exc)) == 0) { if (nl != NULL) gdome_nl_unref (nl, &exc); return; } for (i = nllength-1; i >= 0; i--) { child = gdome_nl_item (nl, i, &exc); str = NULL; if (gdome_n_nodeType (child, &exc) == GDOME_COMMENT_NODE || (gdome_n_nodeType (child, &exc) == GDOME_TEXT_NODE && isSpaceStr ((str = gdome_t_data ((GdomeText *)child, &exc))))) { dchild = gdome_n_removeChild (node, child, &exc); if (str != NULL) gdome_str_unref (str); if (dchild != NULL) gdome_n_unref (dchild, &exc); } else if (gdome_n_hasChildNodes (child, &exc)) cleanSubTree (child); if (child != NULL) gdome_n_unref (child, &exc); } if (nl != NULL) gdome_nl_unref (nl, &exc); } GdomeDOMString *getElContent (GdomeElement *el) { GdomeNode *child; GdomeException exc; g_return_val_if_fail (el != NULL, NULL); child = gdome_el_firstChild (el, &exc); if (el == NULL) fprintf (stderr, "CHILDNULL"); g_return_val_if_fail (child != NULL, NULL); if (gdome_n_nodeType (child, &exc) != GDOME_TEXT_NODE && gdome_n_nodeType (child, &exc) != GDOME_CDATA_SECTION_NODE) { gdome_n_unref (child, &exc); return NULL; } return gdome_t_data ((GdomeText *)child, &exc); } gdome2-0.8.1/test/apigen/srcutil.c0000664000076400007640000002611107435532506012455 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* srcutil.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include "srcutil.h" #define BUFSIZE 1024 #define STARTSTR "/**\n" #define ENDSTR " */\n" extern int writtenAPI; void writeException (FILE *fddest, struct _exception *exception, const gchar *type) { fputs ("\tif (", fddest); fputs (exception->on, fddest); fputs (") {\n" "\t\t*exc = GDOME_", fddest); fputs (exception->type, fddest); fputs (";\n", fddest); if (!strcmp (type, "void")) fputs ("\t\treturn;\n", fddest); else if (!strcmp (type, "GdomeBoolean")) fputs ("\t\treturn FALSE;\n", fddest); else if (!strcmp (type, "GdomeDOMTimeStamp")) fputs ("\t\treturn 0L;\n", fddest); else if (strstr (type, "long")) fputs ("\t\treturn 0L;\n", fddest); else if (strstr (type, "short")) fputs ("\t\treturn 0;\n", fddest); else if (strstr (type, "double")) fputs ("\t\treturn 0;\n", fddest); else if (strstr (type, "int32")) fputs ("\t\treturn 0;\n", fddest); else if (strstr (type, "Gdome") && strstr (type, " *")) fputs ("\t\treturn NULL;\n", fddest); else if (!strcmp (type, "gpointer")) fputs ("\t\treturn NULL;\n", fddest); else if (!strcmp (type, "void *")) fputs ("\t\treturn NULL;\n", fddest); else g_warning ("TYPE NOT FOUND"); fputs ("\t}\n", fddest); } void writeAttributeCall (FILE *fddest, const gchar* name, const gchar* iName, const gchar* modPrefix, const gchar* aName, int degree, gboolean setAttr) { gchar *buf, tmp[BUFSIZE]; int i; tmp[0]='\0'; strcat (tmp, "->"); if (degree != 0) { for (i=0; ivtab",tmp,"set_", name, " (self, ", name, ", exc);\n", NULL); else buf = g_strconcat ("\treturn ((Gdome_",modPrefix,"_",iName," *)self)->vtab",tmp, name, " (self, exc);\n", NULL); } else { if (setAttr) buf = g_strconcat ("\t((Gdome_",modPrefix,"_",iName," *)self)->vtab",tmp,"set_", name, " ((Gdome", aName, " *)self, ", name, ", exc);\n", NULL); else buf = g_strconcat ("\treturn ((Gdome_",modPrefix,"_",iName," *)self)->vtab",tmp, name, " ((Gdome", aName, " *)self, exc);\n", NULL); } fputs (buf, fddest); g_free (buf); writtenAPI++; } gboolean writeAttribute (module *modInfo, const gchar *srcfile, const gchar *iPrefix, const gchar *type, const gchar *name, const gchar *aPrefix, const gchar *aName, const gchar *iName, int degree, gboolean readonly, struct _exception exceptions[]) { FILE *fdsrc, *fddest; gchar *srcFilename; gchar *tofind, *tmp; char buffer[BUFSIZE]; int status = 1, i; gboolean copy = FALSE; srcFilename = g_strconcat (modInfo->srcdir, srcfile, NULL); if ((fdsrc = fopen (srcFilename, "r")) == NULL) { g_free (srcFilename); return FALSE; } g_free (srcFilename); if ((fddest = fopen (modInfo->outfile, "a")) == NULL) { return FALSE; } if (aPrefix == NULL) aPrefix = iPrefix; if (!readonly) status++; tofind = g_strconcat (" * ", modInfo->apiPrefix, "_", modInfo->modPrefix, "_", aPrefix, "_", name, ":\n", NULL); while (status && fgets (buffer, BUFSIZE, fdsrc)) { if (copy) { fputs (buffer, fddest); if (!strcmp (buffer, ENDSTR)) { if (readonly || status == 2) tmp = g_strconcat (type, "\n", NULL); else tmp = g_strdup ("void\n"); fputs (tmp, fddest); g_free (tmp); if (readonly || status == 2) tmp = g_strconcat (modInfo->apiPrefix, "_", iPrefix, "_", name, " (Gdome", iName, " *self, GdomeException *exc)\n", NULL); else tmp = g_strconcat (modInfo->apiPrefix, "_", iPrefix, "_set_", name, " (Gdome", iName, " *self, ", type, name, ", GdomeException *exc)\n", NULL); fputs (tmp, fddest); g_free (tmp); fputs ("{\n",fddest); for (i=0; exceptions[i].type != NULL; i++) if (readonly || status == 2) writeException (fddest, &exceptions[i], type); else writeException (fddest, &exceptions[i], "void"); fputs ("\t*exc = 0;\n", fddest); writeAttributeCall(fddest, name, iName, modInfo->modPrefix, aName, degree, !(readonly || status == 2)); fputs ("}\n",fddest); copy = FALSE; status--; if (status) { g_free (tofind); tofind = g_strconcat (" * ", modInfo->apiPrefix, "_", modInfo->modPrefix, "_", aPrefix, "_set_", name, ":\n", NULL); } } } if (!strcmp (buffer, tofind)) { fputs (STARTSTR, fddest); if (readonly || status == 2) tmp = g_strconcat (" * ", modInfo->apiPrefix, "_", iPrefix, "_", name, ":\n", NULL); else tmp = g_strconcat (" * ", modInfo->apiPrefix, "_", iPrefix, "_set_", name, ":\n", NULL); fputs (tmp, fddest); g_free (tmp); copy = TRUE; } } if (status) printf ("********* %s: not found!!!", tofind); g_free(tofind); fclose (fdsrc); fclose (fddest); return !status; } void writeTitle (module *modInfo, const gchar *name) { FILE *fddest; gchar *tmp; if ((fddest = fopen (modInfo->outfile, "a")) == NULL) { return; } fputs ("\n/******************************************************************************\n",fddest); tmp = g_strconcat (" Gdome",name, " interface API\n", NULL); fputs (tmp, fddest); fputs (" ******************************************************************************/\n",fddest); fclose (fddest); } void writeMethodCall (FILE *fddest, const gchar* name, const gchar* iName, const gchar* modPrefix, const gchar* aName, const gchar* type, int degree, struct _param params[]) { gchar buf[BUFSIZE]; int i; buf[0]='\0'; if (!strcmp (type, "void")) strcat (buf, "\t"); else strcat (buf, "\treturn "); strcat (buf, "((Gdome_"); strcat (buf, modPrefix); strcat (buf, "_"); strcat (buf, iName); strcat (buf, " *)self)->vtab->"); if (degree != 0) { for (i=0; isrcdir, srcfile, NULL); if ((fdsrc = fopen (srcFilename, "r")) == NULL) { g_free (srcFilename); return FALSE; } g_free (srcFilename); if ((fddest = fopen (modInfo->outfile, "a")) == NULL) { return FALSE; } if (aPrefix == NULL) aPrefix = iPrefix; tofind = g_strconcat (" * ", modInfo->apiPrefix, "_", modInfo->modPrefix, "_", aPrefix, "_", name, ":\n", NULL); while (!found && fgets (buffer, BUFSIZE, fdsrc)) { if (copy) { fputs (buffer, fddest); if (!strcmp (buffer, ENDSTR)) { tmp = g_strconcat (type, "\n", NULL); fputs (tmp, fddest); g_free (tmp); if (!raw) tmp = g_strconcat (modInfo->apiPrefix, "_", iPrefix, "_", name, " (Gdome", iName, " *self, ", NULL); else tmp = g_strconcat (modInfo->apiPrefix, "_", iPrefix, "_", name, " (", NULL); for (i=0; params[i].type != NULL; i++) { char *strpos; if ((strpos = strstr(params[i].type, "(*)")) != NULL) { strpos[2]='\0'; tmp1 = g_strconcat(tmp, params[i].type, params[i].name, ")", &strpos[3], ", ", NULL); strpos[2]=')'; } else if ((strpos = strstr(params[i].type, "[")) != NULL) { strpos[0]='\0'; tmp1 = g_strconcat(tmp, params[i].type, params[i].name, "[", &strpos[1], ", ", NULL); strpos[0]='['; } else if (params[i].type[strlen(params[i].type)-1] == '*') tmp1 = g_strconcat(tmp, params[i].type, params[i].name, ", ", NULL); else if (!strcmp (params[i].type, "void") && strlen (params[i].name) == 0) tmp1 = g_strconcat(tmp, params[i].type, ", ", NULL); else tmp1 = g_strconcat(tmp, params[i].type, " ", params[i].name, ", ", NULL); g_free (tmp); tmp = tmp1; } if (!raw) tmp1 = g_strconcat (tmp, "GdomeException *exc)\n", NULL); else { tmp[strlen (tmp)-2] = '\0'; tmp1 = g_strconcat (tmp, ")\n", NULL); } g_free (tmp); fputs (tmp1, fddest); g_free (tmp1); fputs ("{\n",fddest); if (!raw) { for (i=0; exceptions[i].type != NULL; i++) writeException (fddest, &exceptions[i], type); fputs ("\t*exc = 0;\n", fddest); if (impl != NULL) fputs(impl, fddest); writeMethodCall(fddest, name, iName, modInfo->modPrefix, aName, type, degree, params); } else writeRawMethodCall(fddest, tofind, type, params); fputs ("}\n",fddest); copy = FALSE; found = TRUE; } } if (!strcmp (buffer, tofind)) { fputs (STARTSTR, fddest); tmp = g_strconcat (" * ", modInfo->apiPrefix, "_", iPrefix, "_", name, ":\n", NULL); fputs (tmp, fddest); g_free (tmp); copy = TRUE; } } if (!found) printf ("********* %s: not found!!!", tofind); g_free(tofind); fclose (fdsrc); fclose (fddest); return found; } gdome2-0.8.1/test/apigen/apigen.c0000664000076400007640000003275507410566371012246 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* apigen.c * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include "srcutil.h" #include "util.h" #define MAXPARAMS 10 #define MAXEXCEPTION 3 module modInfo; int writtenAPI = 0; void getModuleInfo (GdomeElement *root) { GdomeElement *el; GdomeNodeList *childs; GdomeDOMString *str; GdomeException exc; childs = gdome_el_childNodes (root, &exc); /* SRCDIR */ el = (GdomeElement *)gdome_nl_item (childs, 0, &exc); str = getElContent (el); modInfo.srcdir = g_strdup (str->str); gdome_str_unref (str); gdome_el_unref (el, &exc); /* OUTFILE */ el = (GdomeElement *)gdome_nl_item (childs, 1, &exc); str = getElContent (el); modInfo.outfile = g_strdup (str->str); gdome_str_unref (str); gdome_el_unref (el, &exc); /* APIPREFIX */ el = (GdomeElement *)gdome_nl_item (childs, 2, &exc); str = getElContent (el); modInfo.apiPrefix = g_strdup (str->str); gdome_str_unref (str); gdome_el_unref (el, &exc); /* MODPREFIX */ el = (GdomeElement *)gdome_nl_item (childs, 3, &exc); str = getElContent (el); modInfo.modPrefix = g_strdup (str->str); gdome_str_unref (str); gdome_el_unref (el, &exc); /* OUTFILEHEAD */ el = (GdomeElement *)gdome_nl_item (childs, 4, &exc); if (el == NULL) fprintf (stderr, "ELNULL"); str = getElContent (el); modInfo.outfilehead = g_strdup (str->str); gdome_str_unref (str); gdome_el_unref (el, &exc); } void createInterfaceAPI (GdomeElement *el, GdomeElement *ancestor, unsigned int degree) { GdomeNode *child = NULL; GdomeNode *parent = NULL; GdomeNode *param = NULL; GdomeNode *exception = NULL; GdomeNode *ptmp = NULL; GdomeElement *implementation = NULL; GdomeNodeList *nl = NULL, *nlparams = NULL, *nlexceptions = NULL, *nlimplementation = NULL; GdomeException exc; GdomeDOMString *nameAttr, *nameMethod, *nameElement; GdomeDOMString *name, *srcfile, *iPrefix, *aPrefix = NULL, *content; GdomeDOMString *aName = NULL, *type, *readonly, *str_impl = NULL; GdomeDOMString *tmp1, *tmp2, *tmp3; struct _param params[MAXPARAMS]; struct _exception exceptions[MAXEXCEPTION]; unsigned long i, j, nllength, nlplength, nlelength; gchar *aPrefixStr = NULL, *aNameStr = NULL; gboolean roflag, rawflag; int y; /* Init const strings */ nameAttr = gdome_str_mkref ("ATTR"); nameMethod = gdome_str_mkref ("METHOD"); nameElement = gdome_str_mkref ("INTERFACE"); /* Init strings */ tmp1 = gdome_str_mkref ("NAME"); name = gdome_el_getAttribute (el, tmp1, &exc); gdome_str_unref (tmp1); tmp1 = gdome_str_mkref ("PREFIX"); iPrefix = gdome_el_getAttribute (el, tmp1, &exc); gdome_str_unref (tmp1); if (ancestor == NULL) { printf ("%s:\n", name->str); writeTitle(&modInfo, name->str); tmp1 = gdome_str_mkref ("SRC"); srcfile = gdome_el_getAttribute (el, tmp1, &exc); gdome_str_unref (tmp1); } else { tmp1 = gdome_str_mkref ("NAME"); aName = gdome_el_getAttribute (ancestor, tmp1, &exc); gdome_str_unref (tmp1); aNameStr = aName->str; tmp1 = gdome_str_mkref ("SRC"); srcfile = gdome_el_getAttribute (ancestor, tmp1, &exc); gdome_str_unref (tmp1); tmp1 = gdome_str_mkref ("PREFIX"); aPrefix = gdome_el_getAttribute (ancestor, tmp1, &exc); gdome_str_unref (tmp1); aPrefixStr = aPrefix->str; } /* Creation of the childrens list*/ if (ancestor == NULL) nl = gdome_el_childNodes (el, &exc); else nl = gdome_el_childNodes (ancestor, &exc); nllength = gdome_nl_length (nl, &exc); /* Creation of the local prototypes */ for (i = 0; i < nllength; i++) { child = gdome_nl_item (nl, i, &exc); tmp1 = gdome_n_nodeName (child, &exc); /* If it's an Attribute */ if (gdome_str_equal (tmp1, nameAttr)) { /* get its type */ tmp2 = gdome_str_mkref ("TYPE"); type = gdome_el_getAttribute ((GdomeElement *)child, tmp2, &exc); gdome_str_unref (tmp2); /* get its name */ tmp2 = gdome_str_mkref ("NAME"); content = gdome_el_getAttribute ((GdomeElement *)child, tmp2, &exc); gdome_str_unref (tmp2); /* set roflag (readonly)*/ tmp2 = gdome_str_mkref ("READONLY"); readonly = gdome_el_getAttribute ((GdomeElement *)child, tmp2, &exc); gdome_str_unref (tmp2); tmp2 = gdome_str_mkref ("YES"); if (gdome_str_equal (readonly, tmp2)) roflag = TRUE; else roflag = FALSE; gdome_str_unref (tmp2); /* fill info on exceptions */ tmp2 = gdome_str_mkref ("EXCEPTION"); nlexceptions = gdome_el_getElementsByTagName ((GdomeElement *)child, tmp2, &exc); gdome_str_unref (tmp2); nlelength = gdome_nl_length (nlexceptions, &exc); for (j=0; jstr); gdome_str_unref (tmp3); /* get exception on */ tmp2 = gdome_str_mkref ("ON"); tmp3 = gdome_el_getAttribute ((GdomeElement *)exception, tmp2, &exc); gdome_str_unref (tmp2); exceptions[j].on = g_strdup(tmp3->str); gdome_str_unref (tmp3); gdome_n_unref (exception, &exc); } exceptions[j].type = exceptions[j].on = NULL; gdome_nl_unref (nlexceptions, &exc); if (!writeAttribute(&modInfo, srcfile->str, iPrefix->str, type->str, content->str, aPrefixStr, aNameStr, name->str, degree, roflag, exceptions)) printf ("a: %s %d NO\n", content->str, degree); gdome_str_unref (content); gdome_str_unref (type); gdome_str_unref (readonly); } /* If it's a Method */ else if (gdome_str_equal (tmp1, nameMethod)) { /* get its type */ tmp2 = gdome_str_mkref ("TYPE"); type = gdome_el_getAttribute ((GdomeElement *)child, tmp2, &exc); gdome_str_unref (tmp2); /* get its name */ tmp2 = gdome_str_mkref ("NAME"); content = gdome_el_getAttribute ((GdomeElement *)child, tmp2, &exc); gdome_str_unref (tmp2); /* set rawflag (RAW)*/ rawflag = FALSE; tmp2 = gdome_str_mkref ("RAW"); if (gdome_el_hasAttribute ((GdomeElement *)child, tmp2, &exc)) { tmp3 = gdome_el_getAttribute ((GdomeElement *)child, tmp2, &exc); gdome_str_unref (tmp2); tmp2 = gdome_str_mkref ("YES"); if (gdome_str_equal (tmp3, tmp2)) rawflag = TRUE; } gdome_str_unref (tmp2); /* fill info on exceptions */ tmp2 = gdome_str_mkref ("EXCEPTION"); nlexceptions = gdome_el_getElementsByTagName ((GdomeElement *)child, tmp2, &exc); gdome_str_unref (tmp2); nlelength = gdome_nl_length (nlexceptions, &exc); for (j=0; jstr); gdome_str_unref (tmp3); /* get exception on */ tmp2 = gdome_str_mkref ("ON"); tmp3 = gdome_el_getAttribute ((GdomeElement *)exception, tmp2, &exc); gdome_str_unref (tmp2); exceptions[j].on = g_strdup(tmp3->str); gdome_str_unref (tmp3); gdome_n_unref (exception, &exc); } exceptions[j].type = exceptions[j].on = NULL; gdome_nl_unref (nlexceptions, &exc); /* fill info on params */ tmp2 = gdome_str_mkref ("PARAM"); nlparams = gdome_el_getElementsByTagName ((GdomeElement *)child, tmp2, &exc); gdome_str_unref (tmp2); nlplength = gdome_nl_length (nlparams, &exc); for (j=0; jstr); gdome_str_unref (tmp3); /* get param name */ tmp2 = gdome_str_mkref ("NAME"); tmp3 = gdome_el_getAttribute ((GdomeElement *)param, tmp2, &exc); gdome_str_unref (tmp2); params[j].name = g_strdup(tmp3->str); gdome_str_unref (tmp3); gdome_n_unref (param, &exc); } params[j].type = params[j].name = NULL; gdome_nl_unref (nlparams, &exc); /* fill implementation data */ str_impl = NULL; tmp2 = gdome_str_mkref ("IMPLEMENTATION"); nlimplementation = gdome_el_getElementsByTagName ((GdomeElement *)child, tmp2, &exc); gdome_str_unref (tmp2); if (gdome_nl_length (nlimplementation, &exc) == 1) { implementation = (GdomeElement *)gdome_nl_item (nlimplementation, 0L, &exc); str_impl = getElContent(implementation); gdome_el_unref (implementation, &exc); } gdome_nl_unref (nlimplementation, &exc); if (!rawflag || ancestor == NULL) { if (str_impl != NULL) { if (!writeMethod(&modInfo, srcfile->str, iPrefix->str, type->str, content->str, aPrefixStr, aNameStr, name->str, degree, params, rawflag, exceptions, str_impl->str)) printf ("m: %s %d\n", content->str, degree); gdome_str_unref(str_impl); str_impl = NULL; } else { if (!writeMethod(&modInfo, srcfile->str, iPrefix->str, type->str, content->str, aPrefixStr, aNameStr, name->str, degree, params, rawflag, exceptions, NULL)) printf ("m: %s %d\n", content->str, degree); } } for (j=0; params[j].type != NULL; j++) { g_free (params[j].type); g_free (params[j].name); } gdome_str_unref (content); gdome_str_unref (type); } gdome_str_unref (tmp1); gdome_n_unref (child, &exc); } /* Creation of the inherited prototypes*/ if (ancestor == NULL) { parent = gdome_el_parentNode (el, &exc); tmp1 = gdome_el_tagName ((GdomeElement *)parent, &exc); for (y = 1; gdome_str_equal (tmp1, nameElement); y++) { gdome_str_unref (tmp1); createInterfaceAPI (el, (GdomeElement *)parent, y); ptmp = gdome_el_parentNode ((GdomeElement *)parent, &exc); gdome_n_unref (parent, &exc); gdome_n_ref (ptmp, &exc); parent = ptmp; gdome_n_unref (ptmp, &exc); tmp1 = gdome_el_tagName ((GdomeElement *)parent, &exc); } } gdome_str_unref (nameAttr); gdome_str_unref (nameMethod); gdome_str_unref (nameElement); gdome_str_unref (srcfile); gdome_str_unref (iPrefix); gdome_str_unref (name); if (aPrefix != NULL) gdome_str_unref (aPrefix); if (nl != NULL) gdome_nl_unref (nl, &exc); } void interfacesTraversal (GdomeElement *el) { GdomeNode *child = NULL; GdomeNodeList *nl = NULL; GdomeException exc; GdomeDOMString *str, *name; unsigned long i, nllength; nl = gdome_el_childNodes (el, &exc); if ((nllength = gdome_nl_length (nl, &exc)) == 0) { if (nl != NULL) gdome_nl_unref (nl, &exc); return; } name = gdome_str_mkref ("INTERFACE"); for (i = 0L; i < nllength; i++) { child = gdome_nl_item (nl, i, &exc); str = gdome_n_nodeName (child, &exc); if (gdome_str_equal (str, name)) { createInterfaceAPI ((GdomeElement *)child, NULL, 0); interfacesTraversal ((GdomeElement *)child); } gdome_str_unref (str); gdome_n_unref (child, &exc); } gdome_str_unref (name); if (nl != NULL) gdome_nl_unref (nl, &exc); } int main (int argc, char **argv) { GdomeDOMImplementation *domimpl; GdomeDocument *doc; GdomeElement *rootel; GdomeException exc; FILE *fddest; if (argc < 2) { fprintf (stderr, "Syntax:\n" "\tapigen \n"); return 1; } /* First I get a DOMImplementation reference */ domimpl = gdome_di_mkref (); /* I load a new document from the file name "exampleb.xml */ doc = gdome_di_createDocFromURI(domimpl, argv[1], GDOME_LOAD_PARSING, &exc); if (doc == NULL) { fprintf (stderr, "DOMImplementation.parseFile: failed\n\tException #%d\n", exc); return 1; } /* I get reference to the root element of the document */ rootel = gdome_doc_documentElement (doc, &exc); if (rootel == NULL) { fprintf (stderr, "Document.documentElement: NULL\n\tException #%d\n", exc); return 1; } cleanSubTree ((GdomeNode *)rootel); getModuleInfo (rootel); /* I create the outfile with ites head */ remove (modInfo.outfile); if ((fddest = fopen (modInfo.outfile, "a")) == NULL) return 1; if (!fwrite (modInfo.outfilehead, strlen (modInfo.outfilehead), 1, fddest)) return 1; fclose (fddest); /* I create the API */ interfacesTraversal (rootel); /* I free the document structure and the DOMImplementation */ gdome_di_freeDoc (domimpl, doc, &exc); gdome_di_unref (domimpl, &exc); printf ("\nWritten API: %d\n", writtenAPI); return 0; } gdome2-0.8.1/test/apigen/util.h0000664000076400007640000000205107311512652011740 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* util.h * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef APIGEN_UTIL #define APIGEN_UTIL void cleanSubTree (GdomeNode *node); GdomeDOMString * getElContent (GdomeElement *el); #endif /* APIGEN_UTIL */ gdome2-0.8.1/test/apigen/srcutil.h0000664000076400007640000000512207377235717012472 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 2 -*- */ /* srcutil.h * * Copyright (C) 2001 Paolo Casarini * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef APIGEN_SRCUTIL #define APIGEN_SRCUTIL typedef struct _module module; struct _module { gchar *srcdir; gchar *outfile; gchar *apiPrefix; gchar *modPrefix; gchar *outfilehead; }; typedef struct _param param; struct _param { gchar *type; gchar *name; }; typedef struct _exception exception; struct _exception { gchar *type; gchar *on; }; gboolean writeAttribute (module *modInfo, const gchar *srcfile, const gchar *iPrefix, const gchar *type, const gchar *name, const gchar *aPrefix, const gchar *aName, const gchar *iName, int degree, gboolean readonly, struct _exception exceptions[]); void writeTitle (module *modInfo, const gchar *name); gboolean writeMethod (module *modInfo, const gchar *srcfile, const gchar *iPrefix, const gchar *type, const gchar *name, const gchar *aPrefix, const gchar *aName, const gchar *iName, int degree, struct _param params[], gboolean raw, struct _exception exceptions[], const gchar *impl); #endif /* APIGEN_SRCUTIL */ gdome2-0.8.1/test/apigen/core.xml0000664000076400007640000012115307737315576012313 ../../libgdome/gdomecore/ gdome.c gdome xml * Copyright (C) 2000 Mathieu Lacage * CopyRight (C) 2001 Paolo Casarini * * This file is generated automatically. To make changes, edit * test/apigen/core.xml * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "gdome.h" #include "gdome-xml-str.h" #include "gdome-xml-domimpl.h" #include "gdome-xml-nnodem.h" #include "gdome-xml-nodel.h" #include "gdome-xml-domimpl.h" #include "gdome-xml-node.h" #include "gdome-xml-cdata.h" #include "gdome-xml-text.h" #include "gdome-xml-cdatas.h" #include "gdome-xml-comment.h" #include "gdome-xml-document.h" #include "gdome-xml-documentf.h" #include "gdome-xml-documentt.h" #include "gdome-xml-attribute.h" #include "gdome-xml-element.h" #include "gdome-xml-entity.h" #include "gdome-xml-entityref.h" #include "gdome-xml-pi.h" #include "gdome-xml-xmldtdutil.h" #include "gdome-xml-notation.h" #include "gdome-xml-xpns.h" ]]> n == NULL) { if (((Gdome_xml_Node *)self)->refcnt > 0) ((Gdome_xml_Node *)self)->refcnt--; if (((Gdome_xml_Node *)self)->refcnt == 0 && ((Gdome_xml_Node *)self)->ll == NULL) { #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODE); #endif g_free (self); } return; } ]]> root)->n == NULL) { if (--((Gdome_xml_NodeList *)self)->refcnt == 0) { gdome_n_unref (((Gdome_xml_NodeList *)self)->root, exc); if(((Gdome_xml_NodeList *)self)->tagName != NULL) gdome_str_unref(((Gdome_xml_NodeList *)self)->tagName); if(((Gdome_xml_NodeList *)self)->tagURI != NULL) gdome_str_unref(((Gdome_xml_NodeList *)self)->tagURI); #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NODELIST); #endif g_free (self); } return; } ]]> type == GDOME_ATTRIBUTE_NODE && ((Gdome_xml_Node *)((Gdome_xml_NamedNodeMap *)self)->elem)->n == NULL) { if (--((Gdome_xml_NamedNodeMap *)self)->refcnt == 0) { gdome_doc_unref (((Gdome_xml_NamedNodeMap *)self)->doc, exc); gdome_el_unref (((Gdome_xml_NamedNodeMap *)self)->elem, exc); #ifdef DEBUG_REFCNT gdome_refdbg_delRef ((void *)self, GDOME_REFDBG_NAMEDNODEMAP); #endif g_free (self); } return; } ]]> gdome2-0.8.1/test/apigen/events.xml0000664000076400007640000001470507737315576012673 ../../libgdome/events/ gdome-events.c gdome evt * Copyright (C) 2000 Mathieu Lacage * CopyRight (C) 2001 Paolo Casarini * * This file is generated automatically. To make changes, edit * test/apigen/events.xml * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "gdome-events.h" #include "gdome-evt-eventl.h" #include "gdome-evt-event.h" #include "gdome-evt-mevent.h" ]]> gdome2-0.8.1/test/apigen/traversal.xml0000664000076400007640000000672007420511754013351 ../../libgdome/traversal/ gdome-traversal.c gdome trv * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "gdome-traversal.h" #include "gdome-trv-nodeiterator.h" #include "gdome-trv-nodefilter.h" #include "gdome-trv-treewalker.h" ]]> gdome2-0.8.1/test/apigen/xpath.xml0000664000076400007640000001027707437576334012511 ../../libgdome/xpath/ gdome-xpath.c gdome xpath * * This file is generated automatically. To make changes, edit * test/apigen/xpath.xml * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include "gdome.h" #include "gdome-xml-node.h" #include "gdome-xpath.h" #include "gdome-xpath-xpeval.h" #include "gdome-xpath-xpresult.h" #include "gdome-xpath-xpnsresolv.h" ]]> gdome2-0.8.1/gtk-doc/0000777000076400007640000000000007740102244010002 5gdome2-0.8.1/gtk-doc/Makefile.in0000664000076400007640000001720107740102244011766 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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. # The name of the module. 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@ CC = @CC@ CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ DLLTOOL = @DLLTOOL@ ECHO = @ECHO@ EXEEXT = @EXEEXT@ GDOME_INCLUDEDIR = @GDOME_INCLUDEDIR@ GDOME_LIBDIR = @GDOME_LIBDIR@ GDOME_LIBS = @GDOME_LIBS@ GDOME_VERSION_INFO = @GDOME_VERSION_INFO@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_CONFIG = @GLIB_CONFIG@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MIN_VERSION = @GLIB_MIN_VERSION@ GLIB_MKENUMS = @GLIB_MKENUMS@ GLIB_REQUIRED = @GLIB_REQUIRED@ GOBJECT_QUERY = @GOBJECT_QUERY@ LDFLAGS = @LDFLAGS@ LIBTOOL = @LIBTOOL@ LIBXML_CFLAGS = @LIBXML_CFLAGS@ LIBXML_LIBS = @LIBXML_LIBS@ LN_S = @LN_S@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PKG_CONFIG = @PKG_CONFIG@ RANLIB = @RANLIB@ STRIP = @STRIP@ VERSION = @VERSION@ XML_CONFIG = @XML_CONFIG@ XML_MIN_VERSION = @XML_MIN_VERSION@ DOC_MODULE = gdome2-$(VERSION) # The top-level SGML file. DOC_MAIN_SGML_FILE = gdome2-docs.sgml # The directory containing the source code (if it contains documentation). DOC_SOURCE_DIR = ../libgdome HTML_DIR = @HTML_DIR@ TARGET_DIR = $(HTML_DIR)/$(DOC_MODULE) NULL = EXTRA_DIST = \ gdome2-docs.sgml \ gdome2-sections.txt \ html/book1.html \ html/gdome2-basic-types-and-enumerations.html \ html/gdome2-core.html \ html/gdome2-gdomeattr.html \ html/gdome2-gdomecdatasection.html \ html/gdome2-gdomecharacterdata.html \ html/gdome2-gdomecomment.html \ html/gdome2-gdomedocument.html \ html/gdome2-gdomedocumentfragment.html \ html/gdome2-gdomedocumenttype.html \ html/gdome2-gdomedomimplementation.html \ html/gdome2-gdomeelement.html \ html/gdome2-gdomeentity.html \ html/gdome2-gdomeentityreference.html \ html/gdome2-gdomenamednodemap.html \ html/gdome2-gdomenode.html \ html/gdome2-gdomenodelist.html \ html/gdome2-gdomenotation.html \ html/gdome2-gdomeprocessinginstruction.html \ html/gdome2-gdometext.html \ html/gdome2-events-basic-types-and-enumerations.html \ html/gdome2-events.html \ html/gdome2-gdomeevent.html \ html/gdome2-gdomeeventlistener.html \ html/gdome2-xpath.html \ html/gdome2-xpath-basic-types-and-enumerations.html \ html/gdome2-gdomemutationevent.html \ html/gdome2-gdomexpathevaluator.html \ html/gdome2-gdomexpathnamespace.html \ html/gdome2-gdomexpathnsresolver.html \ html/gdome2-gdomexpathresult.html \ html/gdome2-memory.html \ html/gdome2-module-private-list.html \ html/gdome2-module-tree-garbage-collector.html \ html/index.sgml \ $(NULL) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = ../config.h CONFIG_CLEAN_FILES = 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: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps gtk-doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status cd $(top_builddir) \ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status tags: TAGS TAGS: distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) subdir = gtk-doc distdir: $(DISTFILES) $(mkinstalldirs) $(distdir)/html @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-data-local install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall: uninstall-am all-am: Makefile all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: 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-local clean: clean-am distclean-am: distclean-generic clean-am -rm -f libtool distclean: distclean-am maintainer-clean-am: maintainer-clean-generic distclean-am \ maintainer-clean-local @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: tags distdir info-am info dvi-am dvi check check-am \ installcheck-am installcheck install-exec-am install-exec \ install-data-local 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 scan: gtkdoc-scan --module=gdome2 $(DOC_SOURCE_DIR)/gdome.h $(DOC_SOURCE_DIR)/gdome-private-list.h $(DOC_SOURCE_DIR)/gdome-events.h $(DOC_SOURCE_DIR)/gdome-xpath.h $(DOC_SOURCE_DIR)/gdome-treegc.h templates: scan gtkdoc-mktmpl --module=gdome2 sgml: gtkdoc-mkdb --module=gdome2 --source-dir=$(DOC_SOURCE_DIR) html: if ! test -d html ; then mkdir html ; fi -cd html && gtkdoc-mkhtml gdome2 ../$(DOC_MAIN_SGML_FILE) clean-local: rm -f *~ *.bak *.hierarchy *.signals *.args *-unused.txt maintainer-clean-local: clean rm -rf sgml html gdome2-decl-list.txt gdome2-decl.txt install-data-local: -install -d -m 0755 $(TARGET_DIR) -install -m 0644 $(srcdir)/html/*.html $(TARGET_DIR) -install -m 0644 $(srcdir)/html/index.sgml $(TARGET_DIR) -(cd $(DESTDIR); gtkdoc-fixxref --module=$(DOC_MODULE) --html-dir=$(HTML_DIR)) .PHONY : html sgml templates scan # 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: gdome2-0.8.1/gtk-doc/html/0000775000076400007640000000000007740102245010745 5gdome2-0.8.1/gtk-doc/html/book1.html0000664000076400007640000001266407606515346012612 Gdome2 Reference Manual
Table of Contents
Core & XML modules
Basic Types and Enumerations -- Description of basic types, classes and enumeration for "Core" modules.
GdomeDOMImplementation -- Interface DOMImplementation implementation.
GdomeDocumentFragment -- Interface DocumentFragment implementation.
GdomeDocument -- Interface Document implementation.
GdomeNode -- Interface Node implementation.
GdomeNodeList -- Interface NodeList implementation.
GdomeNamedNodeMap -- Interface NamedNodeMap implementation.
GdomeCharacterData -- Interface CharacterData implementation.
GdomeAttr -- Interface Attr implementation.
GdomeElement -- Interface Element implementation.
GdomeText -- Interface Text implementation
GdomeComment -- Interface Comment implementation
GdomeCDATASection -- Interface CDATASection implementation.
GdomeDocumentType -- Interface DocumentType implementation.
GdomeNotation -- Interface Notation implementation.
GdomeEntity -- Interface Entity implementation.
GdomeEntityReference -- Interface EntityReference implementation.
GdomeProcessingInstruction -- Interface ProcessingInstruction implementation.
Events modules
Events Basic Types and Enumerations -- Description of basic types, classes and enumeration for "Events" modules.
GdomeEventListener -- Interface EventListener implementation.
GdomeEvent -- Interface Event implementation.
GdomeMutationEvent -- Interface MutationEvent implementation.
XPath modules
XPath Basic Types and Enumerations -- Description of basic types, classes and enumeration for "XPath" modules.
GdomeXPathEvaluator -- Interface XPathEvaluator implementation.
GdomeXPathNamespace -- Interface XPathNamespace implementation.
GdomeXPathNSResolver -- Interface XPathNSResolver implementation
GdomeXPathResult -- Interface XPathResult implementation.
Memory Management System
Module Private List -- Structures and APIs
Module Tree Garbage Collector -- Structures and APIs
gdome2-0.8.1/gtk-doc/html/gdome2-basic-types-and-enumerations.html0000664000076400007640000013061107633066423020432 Basic Types and Enumerations

Basic Types and Enumerations

Name

Basic Types and Enumerations -- Description of basic types, classes and enumeration for "Core" modules.

Synopsis



enum        GdomeNodeType;
enum        GdomeExceptionCode;
enum        GdomeAccessType;
enum        GdomeLoadingCode;
enum        GdomeSavingCode;

typedef     GdomeBoolean;
typedef     GdomeDOMTimeStamp;
typedef     GdomeException;
struct      GdomeEntitiesTableEntry;

#define     GDOME_A                         (node)
#define     GDOME_C                         (node)
#define     GDOME_CD                        (node)
#define     GDOME_CDS                       (node)
#define     GDOME_DF                        (node)
#define     GDOME_DOC                       (node)
#define     GDOME_DT                        (node)
#define     GDOME_EL                        (node)
#define     GDOME_ENT                       (node)
#define     GDOME_ER                        (node)
#define     GDOME_N                         (node)
#define     GDOME_NOT                       (node)
#define     GDOME_PI                        (node)
#define     GDOME_T                         (node)
#define     GDOME_EVNTT                     (node)

#define     GDOME_XMLNS_NAMESPACE

#define     GDOME_EXCEPTION_TYPE            (exc)
#define     GDOME_EXCEPTION_CODE            (exc)
enum        GdomeExceptionMasks;
enum        GdomeExceptionType;

struct      GdomeDOMString;
GdomeDOMString* gdome_str_mkref             (const gchar *str);
GdomeDOMString* gdome_str_mkref_own         (gchar *str);
GdomeDOMString* gdome_str_mkref_dup         (const gchar *str);
void        gdome_str_ref                   (GdomeDOMString *self);
void        gdome_str_unref                 (GdomeDOMString *self);
GdomeBoolean gdome_str_equal                (GdomeDOMString *self,
                                             GdomeDOMString *str);
GdomeBoolean gdome_str_equalIgnoreCase      (GdomeDOMString *self,
                                             GdomeDOMString *str);
gchar       gdome_str_charAt                (GdomeDOMString *self,
                                             int index);
GdomeDOMString* gdome_str_concat            (GdomeDOMString *self,
                                             GdomeDOMString *str);
GdomeBoolean gdome_str_endsWith             (GdomeDOMString *self,
                                             GdomeDOMString *suffix);
GdomeBoolean gdome_str_isEmpty              (GdomeDOMString *self);
int         gdome_str_length                (GdomeDOMString *self);
GdomeBoolean gdome_str_startsWith           (GdomeDOMString *self,
                                             GdomeDOMString *prefix);

Description

Details

enum GdomeNodeType

typedef enum {
	GDOME_ELEMENT_NODE = 1,
	GDOME_ATTRIBUTE_NODE = 2,
	GDOME_TEXT_NODE = 3,
	GDOME_CDATA_SECTION_NODE = 4,
	GDOME_ENTITY_REFERENCE_NODE = 5,
	GDOME_ENTITY_NODE = 6,
	GDOME_PROCESSING_INSTRUCTION_NODE = 7,
	GDOME_COMMENT_NODE = 8,
	GDOME_DOCUMENT_NODE = 9,
	GDOME_DOCUMENT_TYPE_NODE = 10,
	GDOME_DOCUMENT_FRAGMENT_NODE = 11,
	GDOME_NOTATION_NODE = 12,
	GDOME_XPATH_NAMESPACE_NODE = 13
} GdomeNodeType;


enum GdomeExceptionCode

typedef enum {
  GDOME_NOEXCEPTION_ERR = 0,
	GDOME_INDEX_SIZE_ERR = 1,
	GDOME_DOMSTRING_SIZE_ERR = 2,
	GDOME_HIERARCHY_REQUEST_ERR = 3,
	GDOME_WRONG_DOCUMENT_ERR = 4,
	GDOME_INVALID_CHARACTER_ERR = 5,
	GDOME_NO_DATA_ALLOWED_ERR = 6,
	GDOME_NO_MODIFICATION_ALLOWED_ERR = 7,
	GDOME_NOT_FOUND_ERR = 8,
	GDOME_NOT_SUPPORTED_ERR = 9,
	GDOME_INUSE_ATTRIBUTE_ERR = 10,
	GDOME_INVALID_STATE_ERR = 11,
	GDOME_SYNTAX_ERR = 12,
	GDOME_INVALID_MODIFICATION_ERR = 13,
	GDOME_NAMESPACE_ERR = 14,
	GDOME_INVALID_ACCESS_ERR = 15,
	GDOME_NULL_POINTER_ERR = 100
} GdomeExceptionCode;


enum GdomeAccessType

typedef enum {
	GDOME_READONLY_NODE = 0,
	GDOME_READWRITE_NODE = 1
} GdomeAccessType;


enum GdomeLoadingCode

typedef enum {
	GDOME_LOAD_PARSING = 0,
	GDOME_LOAD_VALIDATING = 1,
	GDOME_LOAD_RECOVERING = 2,
	GDOME_LOAD_SUBSTITUTE_ENTITIES = 4,
	GDOME_LOAD_COMPLETE_ATTRS = 8
} GdomeLoadingCode;


enum GdomeSavingCode

typedef enum {
	GDOME_SAVE_STANDARD = 0,
	GDOME_SAVE_LIBXML_INDENT = 1
} GdomeSavingCode;


GdomeBoolean

typedef int GdomeBoolean;


GdomeDOMTimeStamp

typedef long long GdomeDOMTimeStamp;


GdomeException

typedef guint32 GdomeException;


struct GdomeEntitiesTableEntry

struct GdomeEntitiesTableEntry {
	gchar *name;
	gchar *value;
	gchar *publicID;
	gchar *systemID;
};


GDOME_A()

#define GDOME_A(node) gdome_cast_a((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeAttr one.


GDOME_C()

#define GDOME_C(node) gdome_cast_c((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeComment one.


GDOME_CD()

#define GDOME_CD(node) gdome_cast_cd((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeCharacterData one.


GDOME_CDS()

#define GDOME_CDS(node) gdome_cast_cds((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeCDATASection one.


GDOME_DF()

#define GDOME_DF(node) gdome_cast_df((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeDocumentFragment one.


GDOME_DOC()

#define GDOME_DOC(node) gdome_cast_doc((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeDocument one.


GDOME_DT()

#define GDOME_DT(node) gdome_cast_dt((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeDocumentType one.


GDOME_EL()

#define GDOME_EL(node) gdome_cast_el((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeElement one.


GDOME_ENT()

#define GDOME_ENT(node) gdome_cast_ent((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeEntity one.


GDOME_ER()

#define GDOME_ER(node) gdome_cast_er((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeEntityReference one.


GDOME_N()

#define GDOME_N(node) gdome_cast_n((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeNode one.


GDOME_NOT()

#define GDOME_NOT(node) gdome_cast_not((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeNotation one.


GDOME_PI()

#define GDOME_PI(node) gdome_cast_pi((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeProcessingInstruction one.


GDOME_T()

#define GDOME_T(node) gdome_cast_t((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeText one.


GDOME_EVNTT()

#define GDOME_EVNTT(node) gdome_cast_evntt((GdomeNode *)node)

Cast a ganeral GdomeNode reference to a GdomeEventTarget one.


GDOME_XMLNS_NAMESPACE

#define     GDOME_XMLNS_NAMESPACE

This is the namespace for the xmlns: prefix for namespace declaration attributes.


GDOME_EXCEPTION_TYPE()

#define GDOME_EXCEPTION_TYPE(exc) ((exc) & GDOME_EXCEPTION_TYPE_MASK)


GDOME_EXCEPTION_CODE()

#define GDOME_EXCEPTION_CODE(exc) ((exc) & GDOME_EXCEPTION_CODE_MASK)


enum GdomeExceptionMasks

typedef enum {
	GDOME_EXCEPTION_TYPE_MASK = 0x00FF0000,
	GDOME_EXCEPTION_CODE_MASK = 0x0000FFFF
} GdomeExceptionMasks;


enum GdomeExceptionType

typedef enum {
	GDOME_CORE_EXCEPTION = 0 << 16,
	GDOME_EVENT_EXCEPTION = 1 << 16,
	GDOME_XPATH_EXCEPTION = 2 << 16
} GdomeExceptionType;


struct GdomeDOMString

struct GdomeDOMString {
	gchar *str;
	gint refcnt;
	void (*unref) (GdomeDOMString *self);
};


gdome_str_mkref ()

GdomeDOMString* gdome_str_mkref             (const gchar *str);

Creates a GdomeDOMString from a statically allocated string.


gdome_str_mkref_own ()

GdomeDOMString* gdome_str_mkref_own         (gchar *str);

Creates a GdomeDOMString from a dynamically allocated gchar buffer.


gdome_str_mkref_dup ()

GdomeDOMString* gdome_str_mkref_dup         (const gchar *str);

Creates a GdomeDOMString from a static or dynamically allocated gchar buffer, but a copy of the initializing string is done before construction.


gdome_str_ref ()

void        gdome_str_ref                   (GdomeDOMString *self);

Increase the reference count of the specified GdomeDOMString.


gdome_str_unref ()

void        gdome_str_unref                 (GdomeDOMString *self);

Decrease the reference count of the specified GdomeDOMString. Free the structure if the object will have zero reference.









gdome2-0.8.1/gtk-doc/html/gdome2-core.html0000664000076400007640000001130207606515346013666 Core & XML modules

Core & XML modules

Table of Contents
Basic Types and Enumerations -- Description of basic types, classes and enumeration for "Core" modules.
GdomeDOMImplementation -- Interface DOMImplementation implementation.
GdomeDocumentFragment -- Interface DocumentFragment implementation.
GdomeDocument -- Interface Document implementation.
GdomeNode -- Interface Node implementation.
GdomeNodeList -- Interface NodeList implementation.
GdomeNamedNodeMap -- Interface NamedNodeMap implementation.
GdomeCharacterData -- Interface CharacterData implementation.
GdomeAttr -- Interface Attr implementation.
GdomeElement -- Interface Element implementation.
GdomeText -- Interface Text implementation
GdomeComment -- Interface Comment implementation
GdomeCDATASection -- Interface CDATASection implementation.
GdomeDocumentType -- Interface DocumentType implementation.
GdomeNotation -- Interface Notation implementation.
GdomeEntity -- Interface Entity implementation.
GdomeEntityReference -- Interface EntityReference implementation.
GdomeProcessingInstruction -- Interface ProcessingInstruction implementation.
gdome2-0.8.1/gtk-doc/html/gdome2-gdomeattr.html0000664000076400007640000026113507727712764014746 GdomeAttr

GdomeAttr

Name

GdomeAttr -- Interface Attr implementation.

Synopsis



struct      GdomeAttr;
void        gdome_a_ref                     (GdomeAttr *self,
                                             GdomeException *exc);
void        gdome_a_unref                   (GdomeAttr *self,
                                             GdomeException *exc);
gpointer    gdome_a_query_interface         (GdomeAttr *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_a_name                (GdomeAttr *self,
                                             GdomeException *exc);
GdomeElement* gdome_a_ownerElement          (GdomeAttr *self,
                                             GdomeException *exc);
GdomeBoolean gdome_a_specified              (GdomeAttr *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_a_value               (GdomeAttr *self,
                                             GdomeException *exc);
void        gdome_a_set_value               (GdomeAttr *self,
                                             GdomeDOMString *value,
                                             GdomeException *exc);
GdomeDOMString* gdome_a_nodeName            (GdomeAttr *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_a_nodeValue           (GdomeAttr *self,
                                             GdomeException *exc);
void        gdome_a_set_nodeValue           (GdomeAttr *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_a_nodeType             (GdomeAttr *self,
                                             GdomeException *exc);
GdomeNode*  gdome_a_parentNode              (GdomeAttr *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_a_childNodes           (GdomeAttr *self,
                                             GdomeException *exc);
GdomeNode*  gdome_a_firstChild              (GdomeAttr *self,
                                             GdomeException *exc);
GdomeNode*  gdome_a_lastChild               (GdomeAttr *self,
                                             GdomeException *exc);
GdomeNode*  gdome_a_previousSibling         (GdomeAttr *self,
                                             GdomeException *exc);
GdomeNode*  gdome_a_nextSibling             (GdomeAttr *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_a_attributes       (GdomeAttr *self,
                                             GdomeException *exc);
GdomeDocument* gdome_a_ownerDocument        (GdomeAttr *self,
                                             GdomeException *exc);
GdomeNode*  gdome_a_insertBefore            (GdomeAttr *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_a_replaceChild            (GdomeAttr *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_a_removeChild             (GdomeAttr *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_a_appendChild             (GdomeAttr *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_a_hasChildNodes          (GdomeAttr *self,
                                             GdomeException *exc);
GdomeNode*  gdome_a_cloneNode               (GdomeAttr *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_a_normalize               (GdomeAttr *self,
                                             GdomeException *exc);
GdomeBoolean gdome_a_isSupported            (GdomeAttr *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_a_namespaceURI        (GdomeAttr *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_a_prefix              (GdomeAttr *self,
                                             GdomeException *exc);
void        gdome_a_set_prefix              (GdomeAttr *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_a_localName           (GdomeAttr *self,
                                             GdomeException *exc);
GdomeBoolean gdome_a_hasAttributes          (GdomeAttr *self,
                                             GdomeException *exc);
void        gdome_a_addEventListener        (GdomeAttr *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_a_removeEventListener     (GdomeAttr *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_a_dispatchEvent          (GdomeAttr *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_a_subTreeDispatchEvent    (GdomeAttr *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_a_canAppend              (GdomeAttr *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

The GdomeAttr interface represents an attribute in an GdomeElement object. Typically the allowable values for the attribute are defined in a document type definition.

GdomeAttr objects inherit the GdomeNode interface, but since they are not actually child nodes of the element they describe, the DOM does not consider them part of the document tree. Thus, the methods gdome_a_parentNode(), gdome_a_previousSibling(), and gdome_a_nextSibling(), have a NULL value for GdomeAttr objects. The DOM takes the view that attributes are properties of elements rather than having a separate identity from the elements they are associated with. Furthermore, GdomeAttr nodes may not be immediate children of a GdomeDocumentFragment. However, they can be associated with GdomeElement nodes contained within a GdomeDocumentFragment. In short, users of the DOM need to be aware that GdomeAttr nodes have some things in common with other objects inheriting the GdomeNode interface, but they also are quite distinct.

The attribute's effective value is determined as follows: if this attribute has been explicitly assigned any value, that value is the attribute's effective value; otherwise, if there is a declaration for this attribute, and that declaration includes a default value, then that default value is the attribute's effective value; otherwise, the attribute does not exist on this element in the structure model until it has been explicitly added.

Note: Note that the gdome_a_nodeValue() method on the GdomeAttr instance can also be used to retrieve the string version of the attribute's value(s).

In XML, where the value of an attribute can contain entity references, the child nodes of the GdomeAttr node may be either GdomeText or GdomeEntityReference nodes (when these are in use; see the description of GdomeEntity for discussion). Because the DOM Core is not aware of attribute types, it treats all attribute values as simple strings, even if the DTD or schema declares them as having tokenized types.

Details

struct GdomeAttr

struct GdomeAttr {
	gpointer user_data;
};


gdome_a_ref ()

void        gdome_a_ref                     (GdomeAttr *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_a_unref ()

void        gdome_a_unref                   (GdomeAttr *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_a_specified ()

GdomeBoolean gdome_a_specified              (GdomeAttr *self,
                                             GdomeException *exc);

NOT IMPLEMENTED



gdome_a_set_value ()

void        gdome_a_set_value               (GdomeAttr *self,
                                             GdomeDOMString *value,
                                             GdomeException *exc);

Sets the value of this attribute.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.




gdome_a_set_nodeValue ()

void        gdome_a_set_nodeValue           (GdomeAttr *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_a_insertBefore ()

GdomeNode*  gdome_a_insertBefore            (GdomeAttr *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_a_replaceChild ()

GdomeNode*  gdome_a_replaceChild            (GdomeAttr *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_a_removeChild ()

GdomeNode*  gdome_a_removeChild             (GdomeAttr *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_a_appendChild ()

GdomeNode*  gdome_a_appendChild             (GdomeAttr *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_a_cloneNode ()

GdomeNode*  gdome_a_cloneNode               (GdomeAttr *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_a_normalize ()

void        gdome_a_normalize               (GdomeAttr *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_a_set_prefix ()

void        gdome_a_set_prefix              (GdomeAttr *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_a_addEventListener ()

void        gdome_a_addEventListener        (GdomeAttr *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_a_removeEventListener ()

void        gdome_a_removeEventListener     (GdomeAttr *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_a_dispatchEvent ()

GdomeBoolean gdome_a_dispatchEvent          (GdomeAttr *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_a_subTreeDispatchEvent ()

void        gdome_a_subTreeDispatchEvent    (GdomeAttr *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomecdatasection.html0000664000076400007640000031443407727712764016436 GdomeCDATASection

GdomeCDATASection

Name

GdomeCDATASection -- Interface CDATASection implementation.

Synopsis



struct      GdomeCDATASection;
GdomeText*  gdome_cds_splitText             (GdomeCDATASection *self,
                                             gulong offset,
                                             GdomeException *exc);
GdomeDOMString* gdome_cds_data              (GdomeCDATASection *self,
                                             GdomeException *exc);
void        gdome_cds_set_data              (GdomeCDATASection *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);
gulong      gdome_cds_length                (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_cds_substringData     (GdomeCDATASection *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);
void        gdome_cds_appendData            (GdomeCDATASection *self,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_cds_insertData            (GdomeCDATASection *self,
                                             gulong offset,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_cds_deleteData            (GdomeCDATASection *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);
void        gdome_cds_replaceData           (GdomeCDATASection *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_cds_ref                   (GdomeCDATASection *self,
                                             GdomeException *exc);
void        gdome_cds_unref                 (GdomeCDATASection *self,
                                             GdomeException *exc);
gpointer    gdome_cds_query_interface       (GdomeCDATASection *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_cds_nodeName          (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_cds_nodeValue         (GdomeCDATASection *self,
                                             GdomeException *exc);
void        gdome_cds_set_nodeValue         (GdomeCDATASection *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_cds_nodeType           (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cds_parentNode            (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_cds_childNodes         (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cds_firstChild            (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cds_lastChild             (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cds_previousSibling       (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cds_nextSibling           (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_cds_attributes     (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeDocument* gdome_cds_ownerDocument      (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cds_insertBefore          (GdomeCDATASection *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_cds_replaceChild          (GdomeCDATASection *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_cds_removeChild           (GdomeCDATASection *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_cds_appendChild           (GdomeCDATASection *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_cds_hasChildNodes        (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cds_cloneNode             (GdomeCDATASection *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_cds_normalize             (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeBoolean gdome_cds_isSupported          (GdomeCDATASection *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_cds_namespaceURI      (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_cds_prefix            (GdomeCDATASection *self,
                                             GdomeException *exc);
void        gdome_cds_set_prefix            (GdomeCDATASection *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_cds_localName         (GdomeCDATASection *self,
                                             GdomeException *exc);
GdomeBoolean gdome_cds_hasAttributes        (GdomeCDATASection *self,
                                             GdomeException *exc);
void        gdome_cds_addEventListener      (GdomeCDATASection *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_cds_removeEventListener   (GdomeCDATASection *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_cds_dispatchEvent        (GdomeCDATASection *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_cds_subTreeDispatchEvent  (GdomeCDATASection *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_cds_canAppend            (GdomeCDATASection *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

CDATA sections are used to escape blocks of text containing characters that would otherwise be regarded as markup. The only delimiter that is recognized in a CDATA section is the %"]]>" string that ends the CDATA section. CDATA sections cannot be nested. Their primary purpose is for including material such as XML fragments, without needing to escape all the delimiters.

The GdomeDOMString attribute of the GdomeText node holds the text that is contained by the CDATA section.

The GdomeCDATASection interface inherits from the GdomeCharacterData interface through the GdomeText interface. Adjacent GdomeCDATASection nodes are not merged by use of the gdome_n_normalize() method of the GdomeNode interface.

Details

struct GdomeCDATASection

struct GdomeCDATASection {
	gpointer user_data;
};


gdome_cds_splitText ()

GdomeText*  gdome_cds_splitText             (GdomeCDATASection *self,
                                             gulong offset,
                                             GdomeException *exc);

Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings. After being split, this node will contain all the content up to the offset point. A new node of the same type, which contains all the content at and after the offset point, is returned. If the original node had a parent node, the new node is inserted as the next sibling of the original node. When the offset is equal to the length of this node, the new node has no data.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.



gdome_cds_set_data ()

void        gdome_cds_set_data              (GdomeCDATASection *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);

Sets the data value of this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_cds_substringData ()

GdomeDOMString* gdome_cds_substringData     (GdomeCDATASection *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);

Extracts a range of data from the node.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data.


gdome_cds_appendData ()

void        gdome_cds_appendData            (GdomeCDATASection *self,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cds_insertData ()

void        gdome_cds_insertData            (GdomeCDATASection *self,
                                             gulong offset,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Insert a string at the specified 16-bit unit offset.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cds_deleteData ()

void        gdome_cds_deleteData            (GdomeCDATASection *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);

Remove a range of 16-bit units from the node. If the sum of offset and count exceeds length then all 16-bit units from offset to the end of the data are deleted. Upon success, data and length reflect the change.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cds_replaceData ()

void        gdome_cds_replaceData           (GdomeCDATASection *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Replace the characters starting at the specified 16-bit unit offset with the specified string. If the sum of offset and count exceeds length, then all 16-bit units to the end of the data are replaced;

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cds_ref ()

void        gdome_cds_ref                   (GdomeCDATASection *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_cds_unref ()

void        gdome_cds_unref                 (GdomeCDATASection *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_cds_set_nodeValue ()

void        gdome_cds_set_nodeValue         (GdomeCDATASection *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_cds_insertBefore ()

GdomeNode*  gdome_cds_insertBefore          (GdomeCDATASection *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cds_replaceChild ()

GdomeNode*  gdome_cds_replaceChild          (GdomeCDATASection *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cds_removeChild ()

GdomeNode*  gdome_cds_removeChild           (GdomeCDATASection *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cds_appendChild ()

GdomeNode*  gdome_cds_appendChild           (GdomeCDATASection *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_cds_cloneNode ()

GdomeNode*  gdome_cds_cloneNode             (GdomeCDATASection *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_cds_normalize ()

void        gdome_cds_normalize             (GdomeCDATASection *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_cds_set_prefix ()

void        gdome_cds_set_prefix            (GdomeCDATASection *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_cds_addEventListener ()

void        gdome_cds_addEventListener      (GdomeCDATASection *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_cds_removeEventListener ()

void        gdome_cds_removeEventListener   (GdomeCDATASection *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_cds_dispatchEvent ()

GdomeBoolean gdome_cds_dispatchEvent        (GdomeCDATASection *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_cds_subTreeDispatchEvent ()

void        gdome_cds_subTreeDispatchEvent  (GdomeCDATASection *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomecharacterdata.html0000664000076400007640000030625007727712765016561 GdomeCharacterData

GdomeCharacterData

Name

GdomeCharacterData -- Interface CharacterData implementation.

Synopsis



struct      GdomeCharacterData;
GdomeDOMString* gdome_cd_data               (GdomeCharacterData *self,
                                             GdomeException *exc);
void        gdome_cd_set_data               (GdomeCharacterData *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);
gulong      gdome_cd_length                 (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_cd_substringData      (GdomeCharacterData *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);
void        gdome_cd_appendData             (GdomeCharacterData *self,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_cd_insertData             (GdomeCharacterData *self,
                                             gulong offset,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_cd_deleteData             (GdomeCharacterData *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);
void        gdome_cd_replaceData            (GdomeCharacterData *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_cd_ref                    (GdomeCharacterData *self,
                                             GdomeException *exc);
void        gdome_cd_unref                  (GdomeCharacterData *self,
                                             GdomeException *exc);
gpointer    gdome_cd_query_interface        (GdomeCharacterData *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_cd_nodeName           (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_cd_nodeValue          (GdomeCharacterData *self,
                                             GdomeException *exc);
void        gdome_cd_set_nodeValue          (GdomeCharacterData *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_cd_nodeType            (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cd_parentNode             (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_cd_childNodes          (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cd_firstChild             (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cd_lastChild              (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cd_previousSibling        (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cd_nextSibling            (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_cd_attributes      (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeDocument* gdome_cd_ownerDocument       (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cd_insertBefore           (GdomeCharacterData *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_cd_replaceChild           (GdomeCharacterData *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_cd_removeChild            (GdomeCharacterData *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_cd_appendChild            (GdomeCharacterData *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_cd_hasChildNodes         (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeNode*  gdome_cd_cloneNode              (GdomeCharacterData *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_cd_normalize              (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeBoolean gdome_cd_isSupported           (GdomeCharacterData *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_cd_namespaceURI       (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_cd_prefix             (GdomeCharacterData *self,
                                             GdomeException *exc);
void        gdome_cd_set_prefix             (GdomeCharacterData *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_cd_localName          (GdomeCharacterData *self,
                                             GdomeException *exc);
GdomeBoolean gdome_cd_hasAttributes         (GdomeCharacterData *self,
                                             GdomeException *exc);
void        gdome_cd_addEventListener       (GdomeCharacterData *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_cd_removeEventListener    (GdomeCharacterData *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_cd_dispatchEvent         (GdomeCharacterData *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_cd_subTreeDispatchEvent   (GdomeCharacterData *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_cd_canAppend             (GdomeCharacterData *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

The GdomeCharacterData interface extends GdomeNode with a set of methods for accessing character data in the DOM. For clarity this set is defined here rather than on each object that uses these attributes and methods. No DOM objects correspond directly to GdomeCharacterData, though GdomeText and others do inherit the interface from it. All offsets in this interface start from 0.

As explained in the GdomeDOMString interface, text strings in Gdome2 are represented in UTF-8. In the following, the term 16-bit units is used whenever necessary to indicate that indexing on GdomeCharacterData is done in 16-bit units.

Details

struct GdomeCharacterData

struct GdomeCharacterData {
	gpointer user_data;
};



gdome_cd_set_data ()

void        gdome_cd_set_data               (GdomeCharacterData *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);

Sets the data value of this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_cd_substringData ()

GdomeDOMString* gdome_cd_substringData      (GdomeCharacterData *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);

Extracts a range of data from the node.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data.


gdome_cd_appendData ()

void        gdome_cd_appendData             (GdomeCharacterData *self,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cd_insertData ()

void        gdome_cd_insertData             (GdomeCharacterData *self,
                                             gulong offset,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Insert a string at the specified 16-bit unit offset.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cd_deleteData ()

void        gdome_cd_deleteData             (GdomeCharacterData *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);

Remove a range of 16-bit units from the node. If the sum of offset and count exceeds length then all 16-bit units from offset to the end of the data are deleted. Upon success, data and length reflect the change.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cd_replaceData ()

void        gdome_cd_replaceData            (GdomeCharacterData *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Replace the characters starting at the specified 16-bit unit offset with the specified string. If the sum of offset and count exceeds length, then all 16-bit units to the end of the data are replaced;

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cd_ref ()

void        gdome_cd_ref                    (GdomeCharacterData *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_cd_unref ()

void        gdome_cd_unref                  (GdomeCharacterData *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_cd_set_nodeValue ()

void        gdome_cd_set_nodeValue          (GdomeCharacterData *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_cd_insertBefore ()

GdomeNode*  gdome_cd_insertBefore           (GdomeCharacterData *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cd_replaceChild ()

GdomeNode*  gdome_cd_replaceChild           (GdomeCharacterData *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cd_removeChild ()

GdomeNode*  gdome_cd_removeChild            (GdomeCharacterData *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_cd_appendChild ()

GdomeNode*  gdome_cd_appendChild            (GdomeCharacterData *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_cd_cloneNode ()

GdomeNode*  gdome_cd_cloneNode              (GdomeCharacterData *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_cd_normalize ()

void        gdome_cd_normalize              (GdomeCharacterData *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_cd_set_prefix ()

void        gdome_cd_set_prefix             (GdomeCharacterData *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_cd_addEventListener ()

void        gdome_cd_addEventListener       (GdomeCharacterData *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_cd_removeEventListener ()

void        gdome_cd_removeEventListener    (GdomeCharacterData *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_cd_dispatchEvent ()

GdomeBoolean gdome_cd_dispatchEvent         (GdomeCharacterData *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_cd_subTreeDispatchEvent ()

void        gdome_cd_subTreeDispatchEvent   (GdomeCharacterData *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomecomment.html0000664000076400007640000030153207727712765015433 GdomeComment

GdomeComment

Name

GdomeComment -- Interface Comment implementation

Synopsis



struct      GdomeComment;
GdomeDOMString* gdome_c_data                (GdomeComment *self,
                                             GdomeException *exc);
void        gdome_c_set_data                (GdomeComment *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);
gulong      gdome_c_length                  (GdomeComment *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_c_substringData       (GdomeComment *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);
void        gdome_c_appendData              (GdomeComment *self,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_c_insertData              (GdomeComment *self,
                                             gulong offset,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_c_deleteData              (GdomeComment *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);
void        gdome_c_replaceData             (GdomeComment *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_c_ref                     (GdomeComment *self,
                                             GdomeException *exc);
void        gdome_c_unref                   (GdomeComment *self,
                                             GdomeException *exc);
gpointer    gdome_c_query_interface         (GdomeComment *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_c_nodeName            (GdomeComment *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_c_nodeValue           (GdomeComment *self,
                                             GdomeException *exc);
void        gdome_c_set_nodeValue           (GdomeComment *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_c_nodeType             (GdomeComment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_c_parentNode              (GdomeComment *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_c_childNodes           (GdomeComment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_c_firstChild              (GdomeComment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_c_lastChild               (GdomeComment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_c_previousSibling         (GdomeComment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_c_nextSibling             (GdomeComment *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_c_attributes       (GdomeComment *self,
                                             GdomeException *exc);
GdomeDocument* gdome_c_ownerDocument        (GdomeComment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_c_insertBefore            (GdomeComment *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_c_replaceChild            (GdomeComment *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_c_removeChild             (GdomeComment *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_c_appendChild             (GdomeComment *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_c_hasChildNodes          (GdomeComment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_c_cloneNode               (GdomeComment *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_c_normalize               (GdomeComment *self,
                                             GdomeException *exc);
GdomeBoolean gdome_c_isSupported            (GdomeComment *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_c_namespaceURI        (GdomeComment *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_c_prefix              (GdomeComment *self,
                                             GdomeException *exc);
void        gdome_c_set_prefix              (GdomeComment *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_c_localName           (GdomeComment *self,
                                             GdomeException *exc);
GdomeBoolean gdome_c_hasAttributes          (GdomeComment *self,
                                             GdomeException *exc);
void        gdome_c_addEventListener        (GdomeComment *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_c_removeEventListener     (GdomeComment *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_c_dispatchEvent          (GdomeComment *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_c_subTreeDispatchEvent    (GdomeComment *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_c_canAppend              (GdomeComment *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

This interface inherits from GdomeCharacterData and represents the content of a comment, i.e., all the characters between the starting '<!--' and ending '-->'.

Note: This is the definition of a comment in XML, and, in practice, HTML, although some HTML tools may implement the full SGML comment structure.

Details

struct GdomeComment

struct GdomeComment {
	gpointer user_data;
};



gdome_c_set_data ()

void        gdome_c_set_data                (GdomeComment *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);

Sets the data value of this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_c_substringData ()

GdomeDOMString* gdome_c_substringData       (GdomeComment *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);

Extracts a range of data from the node.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data.


gdome_c_appendData ()

void        gdome_c_appendData              (GdomeComment *self,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_c_insertData ()

void        gdome_c_insertData              (GdomeComment *self,
                                             gulong offset,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Insert a string at the specified 16-bit unit offset.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_c_deleteData ()

void        gdome_c_deleteData              (GdomeComment *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);

Remove a range of 16-bit units from the node. If the sum of offset and count exceeds length then all 16-bit units from offset to the end of the data are deleted. Upon success, data and length reflect the change.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_c_replaceData ()

void        gdome_c_replaceData             (GdomeComment *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Replace the characters starting at the specified 16-bit unit offset with the specified string. If the sum of offset and count exceeds length, then all 16-bit units to the end of the data are replaced;

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_c_ref ()

void        gdome_c_ref                     (GdomeComment *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_c_unref ()

void        gdome_c_unref                   (GdomeComment *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_c_set_nodeValue ()

void        gdome_c_set_nodeValue           (GdomeComment *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_c_insertBefore ()

GdomeNode*  gdome_c_insertBefore            (GdomeComment *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_c_replaceChild ()

GdomeNode*  gdome_c_replaceChild            (GdomeComment *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_c_removeChild ()

GdomeNode*  gdome_c_removeChild             (GdomeComment *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_c_appendChild ()

GdomeNode*  gdome_c_appendChild             (GdomeComment *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_c_cloneNode ()

GdomeNode*  gdome_c_cloneNode               (GdomeComment *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_c_normalize ()

void        gdome_c_normalize               (GdomeComment *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_c_set_prefix ()

void        gdome_c_set_prefix              (GdomeComment *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_c_addEventListener ()

void        gdome_c_addEventListener        (GdomeComment *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_c_removeEventListener ()

void        gdome_c_removeEventListener     (GdomeComment *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_c_dispatchEvent ()

GdomeBoolean gdome_c_dispatchEvent          (GdomeComment *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_c_subTreeDispatchEvent ()

void        gdome_c_subTreeDispatchEvent    (GdomeComment *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomedocument.html0000664000076400007640000037342407727712765015620 GdomeDocument

GdomeDocument

Name

GdomeDocument -- Interface Document implementation.

Synopsis



struct      GdomeDocument;
GdomeDocumentType* gdome_doc_doctype        (GdomeDocument *self,
                                             GdomeException *exc);
GdomeDOMImplementation* gdome_doc_implementation
                                            (GdomeDocument *self,
                                             GdomeException *exc);
GdomeElement* gdome_doc_documentElement     (GdomeDocument *self,
                                             GdomeException *exc);
GdomeElement* gdome_doc_createElement       (GdomeDocument *self,
                                             GdomeDOMString *tagName,
                                             GdomeException *exc);
GdomeDocumentFragment* gdome_doc_createDocumentFragment
                                            (GdomeDocument *self,
                                             GdomeException *exc);
GdomeText*  gdome_doc_createTextNode        (GdomeDocument *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);
GdomeComment* gdome_doc_createComment       (GdomeDocument *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);
GdomeCDATASection* gdome_doc_createCDATASection
                                            (GdomeDocument *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);
GdomeProcessingInstruction* gdome_doc_createProcessingInstruction
                                            (GdomeDocument *self,
                                             GdomeDOMString *target,
                                             GdomeDOMString *data,
                                             GdomeException *exc);
GdomeAttr*  gdome_doc_createAttribute       (GdomeDocument *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);
GdomeEntityReference* gdome_doc_createEntityReference
                                            (GdomeDocument *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);
GdomeNodeList* gdome_doc_getElementsByTagName
                                            (GdomeDocument *self,
                                             GdomeDOMString *tagname,
                                             GdomeException *exc);
GdomeNode*  gdome_doc_importNode            (GdomeDocument *self,
                                             GdomeNode *importedNode,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
GdomeElement* gdome_doc_createElementNS     (GdomeDocument *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *qualifiedName,
                                             GdomeException *exc);
GdomeAttr*  gdome_doc_createAttributeNS     (GdomeDocument *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *qualifiedName,
                                             GdomeException *exc);
GdomeNodeList* gdome_doc_getElementsByTagNameNS
                                            (GdomeDocument *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *localName,
                                             GdomeException *exc);
GdomeElement* gdome_doc_getElementById      (GdomeDocument *self,
                                             GdomeDOMString *elementId,
                                             GdomeException *exc);
GdomeEvent* gdome_doc_createEvent           (GdomeDocument *self,
                                             GdomeDOMString *eventType,
                                             GdomeException *exc);
void        gdome_doc_ref                   (GdomeDocument *self,
                                             GdomeException *exc);
void        gdome_doc_unref                 (GdomeDocument *self,
                                             GdomeException *exc);
gpointer    gdome_doc_query_interface       (GdomeDocument *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_doc_nodeName          (GdomeDocument *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_doc_nodeValue         (GdomeDocument *self,
                                             GdomeException *exc);
void        gdome_doc_set_nodeValue         (GdomeDocument *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_doc_nodeType           (GdomeDocument *self,
                                             GdomeException *exc);
GdomeNode*  gdome_doc_parentNode            (GdomeDocument *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_doc_childNodes         (GdomeDocument *self,
                                             GdomeException *exc);
GdomeNode*  gdome_doc_firstChild            (GdomeDocument *self,
                                             GdomeException *exc);
GdomeNode*  gdome_doc_lastChild             (GdomeDocument *self,
                                             GdomeException *exc);
GdomeNode*  gdome_doc_previousSibling       (GdomeDocument *self,
                                             GdomeException *exc);
GdomeNode*  gdome_doc_nextSibling           (GdomeDocument *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_doc_attributes     (GdomeDocument *self,
                                             GdomeException *exc);
GdomeDocument* gdome_doc_ownerDocument      (GdomeDocument *self,
                                             GdomeException *exc);
GdomeNode*  gdome_doc_insertBefore          (GdomeDocument *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_doc_replaceChild          (GdomeDocument *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_doc_removeChild           (GdomeDocument *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_doc_appendChild           (GdomeDocument *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_doc_hasChildNodes        (GdomeDocument *self,
                                             GdomeException *exc);
GdomeNode*  gdome_doc_cloneNode             (GdomeDocument *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_doc_normalize             (GdomeDocument *self,
                                             GdomeException *exc);
GdomeBoolean gdome_doc_isSupported          (GdomeDocument *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_doc_namespaceURI      (GdomeDocument *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_doc_prefix            (GdomeDocument *self,
                                             GdomeException *exc);
void        gdome_doc_set_prefix            (GdomeDocument *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_doc_localName         (GdomeDocument *self,
                                             GdomeException *exc);
GdomeBoolean gdome_doc_hasAttributes        (GdomeDocument *self,
                                             GdomeException *exc);
void        gdome_doc_addEventListener      (GdomeDocument *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_doc_removeEventListener   (GdomeDocument *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_doc_dispatchEvent        (GdomeDocument *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_doc_subTreeDispatchEvent  (GdomeDocument *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_doc_canAppend            (GdomeDocument *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

The GdomeDocument interface represents the entire HTML or XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data.

Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a GdomeDocument, the GdomeDocument interface also contains the factory methods needed to create these objects. The GdomeNode objects created have a gdome_n_ownerDocument() method which associates them with the GdomeDocument within whose context they were created.

Details

struct GdomeDocument

struct GdomeDocument {
	gpointer user_data;
};





gdome_doc_createElement ()

GdomeElement* gdome_doc_createElement       (GdomeDocument *self,
                                             GdomeDOMString *tagName,
                                             GdomeException *exc);

Creates an element of the type specified. Note that the instance returned implements the Element interface, so attributes can be specified directly on the returned object. To create an element with a qualified name and namespace URI, use the gdome_doc_createElementNS() function.


gdome_doc_createDocumentFragment ()

GdomeDocumentFragment* gdome_doc_createDocumentFragment
                                            (GdomeDocument *self,
                                             GdomeException *exc);

Creates an empty DocumentFragment object.


gdome_doc_createTextNode ()

GdomeText*  gdome_doc_createTextNode        (GdomeDocument *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);

Creates a Text node given the specified string.


gdome_doc_createComment ()

GdomeComment* gdome_doc_createComment       (GdomeDocument *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);

Creates a Comment node whose value is the specified string.


gdome_doc_createCDATASection ()

GdomeCDATASection* gdome_doc_createCDATASection
                                            (GdomeDocument *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);

Creates a CDATASection node whose value is the specified string.


gdome_doc_createProcessingInstruction ()

GdomeProcessingInstruction* gdome_doc_createProcessingInstruction
                                            (GdomeDocument *self,
                                             GdomeDOMString *target,
                                             GdomeDOMString *data,
                                             GdomeException *exc);

Creates a ProcessingInstruction node given the specified name and data strings.


gdome_doc_createAttribute ()

GdomeAttr*  gdome_doc_createAttribute       (GdomeDocument *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);

Creates an Attr of the given name. Note that the Attr instance can then be set on an Element using the setAttributeNode method. To create an attribute with a qualified name and namespace URI, use the gdome_doc_createAttributeNS() method.


gdome_doc_createEntityReference ()

GdomeEntityReference* gdome_doc_createEntityReference
                                            (GdomeDocument *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);

Creates an EntityReference object. In addition, if the referenced entity is known, the child list of the EntityReference node is made the same as that of the corresponding Entity node.



gdome_doc_importNode ()

GdomeNode*  gdome_doc_importNode            (GdomeDocument *self,
                                             GdomeNode *importedNode,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Imports a node from another document to this document. The returned node has no parent; (parentNode is NULL). The source node is not altered or removed from the original document; this method creates a new copy of the source node. GDOME_DOCUMENT_NODE, GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported.


gdome_doc_createElementNS ()

GdomeElement* gdome_doc_createElementNS     (GdomeDocument *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *qualifiedName,
                                             GdomeException *exc);

Creates an element of the given qualified name and namespace URI.

GDOME_NAMESPACE_ERR: Raised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is NULL, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace".


gdome_doc_createAttributeNS ()

GdomeAttr*  gdome_doc_createAttributeNS     (GdomeDocument *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *qualifiedName,
                                             GdomeException *exc);

Creates an attribute of the given qualified name and namespace URI.

GDOME_NAMESPACE_ERR: Raised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is NUKK, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace", or if the qualifiedName is "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/".




gdome_doc_createEvent ()

GdomeEvent* gdome_doc_createEvent           (GdomeDocument *self,
                                             GdomeDOMString *eventType,
                                             GdomeException *exc);

If the Event interface specified is supported by the implementation this method will return a new Event of the interface type requested. If the Event is to be dispatched via the dispatchEvent method the appropriate event init method must be called after creation in order to initialize the Event's values. As an example, a user wishing to synthesize some kind of MutationEvents would call createEvent with the parameter "MutationEvents". The gdome_mevnt_initMuatationEvent() method could then be called on the newly created MutationEvent to set the specific type of MutationEvent to be dispatched and set its context information.

GDOME_NOT_SUPPORTED_ERR: Raised if the implementation does not support the type of Event interface requested


gdome_doc_ref ()

void        gdome_doc_ref                   (GdomeDocument *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_doc_unref ()

void        gdome_doc_unref                 (GdomeDocument *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_doc_set_nodeValue ()

void        gdome_doc_set_nodeValue         (GdomeDocument *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_doc_insertBefore ()

GdomeNode*  gdome_doc_insertBefore          (GdomeDocument *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_doc_replaceChild ()

GdomeNode*  gdome_doc_replaceChild          (GdomeDocument *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_doc_removeChild ()

GdomeNode*  gdome_doc_removeChild           (GdomeDocument *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_doc_appendChild ()

GdomeNode*  gdome_doc_appendChild           (GdomeDocument *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_doc_cloneNode ()

GdomeNode*  gdome_doc_cloneNode             (GdomeDocument *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_doc_normalize ()

void        gdome_doc_normalize             (GdomeDocument *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_doc_set_prefix ()

void        gdome_doc_set_prefix            (GdomeDocument *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_doc_addEventListener ()

void        gdome_doc_addEventListener      (GdomeDocument *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_doc_removeEventListener ()

void        gdome_doc_removeEventListener   (GdomeDocument *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_doc_dispatchEvent ()

GdomeBoolean gdome_doc_dispatchEvent        (GdomeDocument *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_doc_subTreeDispatchEvent ()

void        gdome_doc_subTreeDispatchEvent  (GdomeDocument *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomedocumentfragment.html0000664000076400007640000024612007727712765017334 GdomeDocumentFragment

GdomeDocumentFragment

Name

GdomeDocumentFragment -- Interface DocumentFragment implementation.

Synopsis



struct      GdomeDocumentFragment;
void        gdome_df_ref                    (GdomeDocumentFragment *self,
                                             GdomeException *exc);
void        gdome_df_unref                  (GdomeDocumentFragment *self,
                                             GdomeException *exc);
gpointer    gdome_df_query_interface        (GdomeDocumentFragment *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_df_nodeName           (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_df_nodeValue          (GdomeDocumentFragment *self,
                                             GdomeException *exc);
void        gdome_df_set_nodeValue          (GdomeDocumentFragment *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_df_nodeType            (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_df_parentNode             (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_df_childNodes          (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_df_firstChild             (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_df_lastChild              (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_df_previousSibling        (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_df_nextSibling            (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_df_attributes      (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeDocument* gdome_df_ownerDocument       (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_df_insertBefore           (GdomeDocumentFragment *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_df_replaceChild           (GdomeDocumentFragment *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_df_removeChild            (GdomeDocumentFragment *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_df_appendChild            (GdomeDocumentFragment *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_df_hasChildNodes         (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeNode*  gdome_df_cloneNode              (GdomeDocumentFragment *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_df_normalize              (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeBoolean gdome_df_isSupported           (GdomeDocumentFragment *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_df_namespaceURI       (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_df_prefix             (GdomeDocumentFragment *self,
                                             GdomeException *exc);
void        gdome_df_set_prefix             (GdomeDocumentFragment *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_df_localName          (GdomeDocumentFragment *self,
                                             GdomeException *exc);
GdomeBoolean gdome_df_hasAttributes         (GdomeDocumentFragment *self,
                                             GdomeException *exc);
void        gdome_df_addEventListener       (GdomeDocumentFragment *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_df_removeEventListener    (GdomeDocumentFragment *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_df_dispatchEvent         (GdomeDocumentFragment *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_df_subTreeDispatchEvent   (GdomeDocumentFragment *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_df_canAppend             (GdomeDocumentFragment *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

GdomeDocumentFragment is a "lightweight" or "minimal" GdomeDocument object. It is common to want to be able to extract a portion of a document's tree or to create a new fragment of a document. Imagine implementing a user command like cut or rearranging a document by moving fragments around. It is desirable to have an object which can hold such fragments and it is quite natural to use a GdomeNode for this purpose. While it is true that a GdomeDocument object could fulfill this role, a GdomeDocument object can potentially be a heavyweight object. What is really needed for this is a very lightweight object. GdomeDocumentFragment is such an object.

Furthermore, various operations -- such as inserting nodes as children of another GdomeNode -- may take GdomeDocumentFragment objects as arguments; this results in all the child nodes of the GdomeDocumentFragment being moved to the child list of this node.

The children of a GdomeDocumentFragment node are zero or more nodes representing the tops of any sub-trees defining the structure of the document. GdomeDocumentFragment nodes do not need to be well-formed XML documents (although they do need to follow the rules imposed upon well-formed XML parsed entities, which can have multiple top nodes). For example, a GdomeDocumentFragment might have only one child and that child node could be a GdomeText node. Such a structure model represents neither an HTML document nor a well-formed XML document.

When a GdomeDocumentFragment is inserted into a GdomeDocument (or indeed any other GdomeNode that may take children) the children of the GdomeDocumentFragment and not the GdomeDocumentFragment itself are inserted into the GdomeNode. This makes the GdomeDocumentFragment very useful when the user wishes to create nodes that are siblings; the GdomeDocumentFragment acts as the parent of these nodes so that the user can use the standard methods from the GdomeNode interface, such as gdome_n_insertBefore() and gdome_n_appendChild().

Details

struct GdomeDocumentFragment

struct GdomeDocumentFragment {
	gpointer user_data;
};


gdome_df_ref ()

void        gdome_df_ref                    (GdomeDocumentFragment *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_df_unref ()

void        gdome_df_unref                  (GdomeDocumentFragment *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_df_set_nodeValue ()

void        gdome_df_set_nodeValue          (GdomeDocumentFragment *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_df_insertBefore ()

GdomeNode*  gdome_df_insertBefore           (GdomeDocumentFragment *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_df_replaceChild ()

GdomeNode*  gdome_df_replaceChild           (GdomeDocumentFragment *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_df_removeChild ()

GdomeNode*  gdome_df_removeChild            (GdomeDocumentFragment *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_df_appendChild ()

GdomeNode*  gdome_df_appendChild            (GdomeDocumentFragment *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_df_cloneNode ()

GdomeNode*  gdome_df_cloneNode              (GdomeDocumentFragment *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_df_normalize ()

void        gdome_df_normalize              (GdomeDocumentFragment *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_df_set_prefix ()

void        gdome_df_set_prefix             (GdomeDocumentFragment *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_df_addEventListener ()

void        gdome_df_addEventListener       (GdomeDocumentFragment *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_df_removeEventListener ()

void        gdome_df_removeEventListener    (GdomeDocumentFragment *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_df_dispatchEvent ()

GdomeBoolean gdome_df_dispatchEvent         (GdomeDocumentFragment *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_df_subTreeDispatchEvent ()

void        gdome_df_subTreeDispatchEvent   (GdomeDocumentFragment *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomedocumenttype.html0000664000076400007640000026507307727712765016522 GdomeDocumentType

GdomeDocumentType

Name

GdomeDocumentType -- Interface DocumentType implementation.

Synopsis



struct      GdomeDocumentType;
GdomeDOMString* gdome_dt_name               (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_dt_entities        (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_dt_notations       (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_dt_publicId           (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_dt_systemId           (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_dt_internalSubset     (GdomeDocumentType *self,
                                             GdomeException *exc);
void        gdome_dt_ref                    (GdomeDocumentType *self,
                                             GdomeException *exc);
void        gdome_dt_unref                  (GdomeDocumentType *self,
                                             GdomeException *exc);
gpointer    gdome_dt_query_interface        (GdomeDocumentType *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_dt_nodeName           (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_dt_nodeValue          (GdomeDocumentType *self,
                                             GdomeException *exc);
void        gdome_dt_set_nodeValue          (GdomeDocumentType *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_dt_nodeType            (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeNode*  gdome_dt_parentNode             (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_dt_childNodes          (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeNode*  gdome_dt_firstChild             (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeNode*  gdome_dt_lastChild              (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeNode*  gdome_dt_previousSibling        (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeNode*  gdome_dt_nextSibling            (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_dt_attributes      (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeDocument* gdome_dt_ownerDocument       (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeNode*  gdome_dt_insertBefore           (GdomeDocumentType *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_dt_replaceChild           (GdomeDocumentType *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_dt_removeChild            (GdomeDocumentType *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_dt_appendChild            (GdomeDocumentType *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_dt_hasChildNodes         (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeNode*  gdome_dt_cloneNode              (GdomeDocumentType *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_dt_normalize              (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeBoolean gdome_dt_isSupported           (GdomeDocumentType *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_dt_namespaceURI       (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_dt_prefix             (GdomeDocumentType *self,
                                             GdomeException *exc);
void        gdome_dt_set_prefix             (GdomeDocumentType *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_dt_localName          (GdomeDocumentType *self,
                                             GdomeException *exc);
GdomeBoolean gdome_dt_hasAttributes         (GdomeDocumentType *self,
                                             GdomeException *exc);
void        gdome_dt_addEventListener       (GdomeDocumentType *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_dt_removeEventListener    (GdomeDocumentType *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_dt_dispatchEvent         (GdomeDocumentType *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_dt_subTreeDispatchEvent   (GdomeDocumentType *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_dt_canAppend             (GdomeDocumentType *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

Each GdomeDocument has a gdome_doc_doctype() method whose value is either NULL or a GdomeDocumentType object. The GdomeDocumentType interface in the DOM Core provides an interface to the list of entities that are defined for the document, and little else because the effect of namespaces and the various XML schema efforts on DTD representation are not clearly understood as of writing DOM level 2 specifications.

Note: The DOM Level 2 doesn't support editing GdomeDocumentType nodes.

Details

struct GdomeDocumentType

struct GdomeDocumentType {
	gpointer user_data;
};








gdome_dt_ref ()

void        gdome_dt_ref                    (GdomeDocumentType *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_dt_unref ()

void        gdome_dt_unref                  (GdomeDocumentType *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_dt_set_nodeValue ()

void        gdome_dt_set_nodeValue          (GdomeDocumentType *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_dt_insertBefore ()

GdomeNode*  gdome_dt_insertBefore           (GdomeDocumentType *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_dt_replaceChild ()

GdomeNode*  gdome_dt_replaceChild           (GdomeDocumentType *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_dt_removeChild ()

GdomeNode*  gdome_dt_removeChild            (GdomeDocumentType *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_dt_appendChild ()

GdomeNode*  gdome_dt_appendChild            (GdomeDocumentType *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_dt_cloneNode ()

GdomeNode*  gdome_dt_cloneNode              (GdomeDocumentType *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_dt_normalize ()

void        gdome_dt_normalize              (GdomeDocumentType *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_dt_set_prefix ()

void        gdome_dt_set_prefix             (GdomeDocumentType *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_dt_addEventListener ()

void        gdome_dt_addEventListener       (GdomeDocumentType *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_dt_removeEventListener ()

void        gdome_dt_removeEventListener    (GdomeDocumentType *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_dt_dispatchEvent ()

GdomeBoolean gdome_dt_dispatchEvent         (GdomeDocumentType *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_dt_subTreeDispatchEvent ()

void        gdome_dt_subTreeDispatchEvent   (GdomeDocumentType *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomedomimplementation.html0000664000076400007640000016623107727712765017523 GdomeDOMImplementation

GdomeDOMImplementation

Name

GdomeDOMImplementation -- Interface DOMImplementation implementation.

Synopsis



struct      GdomeDOMImplementation;
GdomeDOMImplementation* gdome_di_mkref      (void);
void        gdome_di_ref                    (GdomeDOMImplementation *self,
                                             GdomeException *exc);
void        gdome_di_unref                  (GdomeDOMImplementation *self,
                                             GdomeException *exc);
gpointer    gdome_di_query_interface        (GdomeDOMImplementation *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeBoolean gdome_di_hasFeature            (GdomeDOMImplementation *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDocumentType* gdome_di_createDocumentType
                                            (GdomeDOMImplementation *self,
                                             GdomeDOMString *qualifiedName,
                                             GdomeDOMString *publicId,
                                             GdomeDOMString *systemId,
                                             GdomeException *exc);
GdomeDocument* gdome_di_createDocument      (GdomeDOMImplementation *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *qualifiedName,
                                             GdomeDocumentType *doctype,
                                             GdomeException *exc);
void        gdome_di_freeDoc                (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             GdomeException *exc);
GdomeDocument* gdome_di_createDocFromURI    (GdomeDOMImplementation *self,
                                             const char *uri,
                                             unsigned int mode,
                                             GdomeException *exc);
GdomeDocument* gdome_di_createDocFromMemory (GdomeDOMImplementation *self,
                                             char *buffer,
                                             unsigned int mode,
                                             GdomeException *exc);
GdomeDocument* gdome_di_createDocFromURIWithEntitiesTable
                                            (GdomeDOMImplementation *self,
                                             const char *uri,
                                             const GdomeEntitiesTableEntry entityTable[],
                                             unsigned int mode,
                                             GdomeException *exc);
GdomeDocument* gdome_di_createDocFromMemoryWithEntitiesTable
                                            (GdomeDOMImplementation *self,
                                             char *buffer,
                                             const GdomeEntitiesTableEntry entityTable[],
                                             unsigned int mode,
                                             GdomeException *exc);
GdomeBoolean gdome_di_saveDocToFile         (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             const char *filename,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);
GdomeBoolean gdome_di_saveDocToFileEnc      (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             const char *filename,
                                             const char *encoding,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);
GdomeBoolean gdome_di_saveDocToMemory       (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             char **mem,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);
GdomeBoolean gdome_di_saveDocToMemoryEnc    (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             char **mem,
                                             const char *encoding,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);
void        gdome_di_enableEvent            (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             const char *name,
                                             GdomeException *exc);
void        gdome_di_disableEvent           (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             const char *name,
                                             GdomeException *exc);
GdomeBoolean gdome_di_eventIsEnabled        (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             const char *name,
                                             GdomeException *exc);

Description

The GdomeDOMImplementation interface provides a number of methods for performing operations that are independent of any particular instance of the document object model.

Details

struct GdomeDOMImplementation

struct GdomeDOMImplementation {
	gpointer user_data;
};


gdome_di_mkref ()

GdomeDOMImplementation* gdome_di_mkref      (void);

Constructor of the DOMImplementation interface.


gdome_di_ref ()

void        gdome_di_ref                    (GdomeDOMImplementation *self,
                                             GdomeException *exc);

Increase the reference count of the DOMImplementation structure.


gdome_di_unref ()

void        gdome_di_unref                  (GdomeDOMImplementation *self,
                                             GdomeException *exc);

Decrease the reference count of the DOMImplementation. Free the structure if DOMImplementation will have zero reference.




gdome_di_createDocumentType ()

GdomeDocumentType* gdome_di_createDocumentType
                                            (GdomeDOMImplementation *self,
                                             GdomeDOMString *qualifiedName,
                                             GdomeDOMString *publicId,
                                             GdomeDOMString *systemId,
                                             GdomeException *exc);

Creates an empty DocumentType node. Entity declarations and notations are not made available. Entity reference expansions and default attribute additions do not occur. It is expected that a future version of the DOM will provide a way for populating a DocumentType.

GDOME_NAMESPACE_ERR: Raised if the qualifiedName is malformed.


gdome_di_createDocument ()

GdomeDocument* gdome_di_createDocument      (GdomeDOMImplementation *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *qualifiedName,
                                             GdomeDocumentType *doctype,
                                             GdomeException *exc);

Creates an XML Document object of the specified type with its document element.

GDOME_NAMESPACE_ERR: Raised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is NULL, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace" GDOME_WRONG_DOCUMENT_ERR: Raised if doctype has already been used with a different document.


gdome_di_freeDoc ()

void        gdome_di_freeDoc                (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             GdomeException *exc);

DEPRECATED! Free all objects and structures associated to the Document specified.


gdome_di_createDocFromURI ()

GdomeDocument* gdome_di_createDocFromURI    (GdomeDOMImplementation *self,
                                             const char *uri,
                                             unsigned int mode,
                                             GdomeException *exc);

Loads a XML Document from a URI and build a DOM tree. If mode is GDOME_LOAD_PARSING the document must be well formed, if mode is GDOME_LOAD_VALIDATING the document must valid and if mode is GDOME_LOAD_RECOVERING a tree is built anyway. If the GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is performed (es. mode = GDOME_LOAD_PARSING | GDOME_LOAD_SUBSTITUTE_ENTITIES ). If the GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated with default attributes from the DTD.


gdome_di_createDocFromMemory ()

GdomeDocument* gdome_di_createDocFromMemory (GdomeDOMImplementation *self,
                                             char *buffer,
                                             unsigned int mode,
                                             GdomeException *exc);

Loads a XML Document from a memory buffer and build a DOM tree. If mode is GDOME_LOAD_PARSING the document must be well formed, if mode is GDOME_LOAD_VALIDATING the document must valid and if mode is GDOME_LOAD_RECOVERING a tree is built anyway. If the GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is performed (es. mode = GDOME_LOAD_PARSING | GDOME_LOAD_SUBSTITUTE_ENTITIES ). If the GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated with default attributes from the DTD.


gdome_di_createDocFromURIWithEntitiesTable ()

GdomeDocument* gdome_di_createDocFromURIWithEntitiesTable
                                            (GdomeDOMImplementation *self,
                                             const char *uri,
                                             const GdomeEntitiesTableEntry entityTable[],
                                             unsigned int mode,
                                             GdomeException *exc);

Loads a XML Document using also entity declaration specified in entityTable from a URI and build a DOM tree. If mode is GDOME_LOAD_PARSING the document must be well formed, if mode is GDOME_LOAD_VALIDATING the document must valid and if mode is GDOME_LOAD_RECOVERING a tree is built anyway. If the GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is performed (es. mode = GDOME_LOAD_PARSING | GDOME_LOAD_SUBSTITUTE_ENTITIES ). If the GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated with default attributes from the DTD.


gdome_di_createDocFromMemoryWithEntitiesTable ()

GdomeDocument* gdome_di_createDocFromMemoryWithEntitiesTable
                                            (GdomeDOMImplementation *self,
                                             char *buffer,
                                             const GdomeEntitiesTableEntry entityTable[],
                                             unsigned int mode,
                                             GdomeException *exc);

Loads a XML Document using also entity declaration specified in entityTable from a memory buffer and build a DOM tree. If mode is GDOME_LOAD_PARSING the document must be well formed, if mode is GDOME_LOAD_VALIDATING the document must valid and if mode is GDOME_LOAD_RECOVERING a tree is built anyway. If the GDOME_LOAD_SUBSTITUTE_ENTITIES flag is added, entity substitution is performed (es. mode = GDOME_LOAD_PARSING | GDOME_LOAD_SUBSTITUTE_ENTITIES ). If the GDOME_LOAD_COMPLETE_ATTR flag is set, the tree is populated with default attributes from the DTD.





gdome_di_saveDocToMemoryEnc ()

GdomeBoolean gdome_di_saveDocToMemoryEnc    (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             char **mem,
                                             const char *encoding,
                                             GdomeSavingCode mode,
                                             GdomeException *exc);

Save the DOM tree of the Document specified using the specified character encoding standard to a new allocated memory and return it in the mem pointer.


gdome_di_enableEvent ()

void        gdome_di_enableEvent            (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             const char *name,
                                             GdomeException *exc);

Enables the propagation of the event type specified.


gdome_di_disableEvent ()

void        gdome_di_disableEvent           (GdomeDOMImplementation *self,
                                             GdomeDocument *doc,
                                             const char *name,
                                             GdomeException *exc);

Disables the propagation of the event type specified.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomeelement.html0000664000076400007640000036305207727712765015427 GdomeElement

GdomeElement

Name

GdomeElement -- Interface Element implementation.

Synopsis



struct      GdomeElement;
GdomeDOMString* gdome_el_tagName            (GdomeElement *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_el_getAttribute       (GdomeElement *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);
void        gdome_el_setAttribute           (GdomeElement *self,
                                             GdomeDOMString *name,
                                             GdomeDOMString *value,
                                             GdomeException *exc);
void        gdome_el_removeAttribute        (GdomeElement *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);
GdomeAttr*  gdome_el_getAttributeNode       (GdomeElement *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);
GdomeAttr*  gdome_el_setAttributeNode       (GdomeElement *self,
                                             GdomeAttr *newAttr,
                                             GdomeException *exc);
GdomeAttr*  gdome_el_removeAttributeNode    (GdomeElement *self,
                                             GdomeAttr *oldAttr,
                                             GdomeException *exc);
GdomeNodeList* gdome_el_getElementsByTagName
                                            (GdomeElement *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);
GdomeDOMString* gdome_el_getAttributeNS     (GdomeElement *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *localName,
                                             GdomeException *exc);
void        gdome_el_setAttributeNS         (GdomeElement *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *qualifiedName,
                                             GdomeDOMString *value,
                                             GdomeException *exc);
void        gdome_el_removeAttributeNS      (GdomeElement *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *localName,
                                             GdomeException *exc);
GdomeAttr*  gdome_el_getAttributeNodeNS     (GdomeElement *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *localName,
                                             GdomeException *exc);
GdomeAttr*  gdome_el_setAttributeNodeNS     (GdomeElement *self,
                                             GdomeAttr *newAttr,
                                             GdomeException *exc);
GdomeNodeList* gdome_el_getElementsByTagNameNS
                                            (GdomeElement *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *localName,
                                             GdomeException *exc);
GdomeBoolean gdome_el_hasAttribute          (GdomeElement *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);
GdomeBoolean gdome_el_hasAttributeNS        (GdomeElement *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *localName,
                                             GdomeException *exc);
void        gdome_el_ref                    (GdomeElement *self,
                                             GdomeException *exc);
void        gdome_el_unref                  (GdomeElement *self,
                                             GdomeException *exc);
gpointer    gdome_el_query_interface        (GdomeElement *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_el_nodeName           (GdomeElement *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_el_nodeValue          (GdomeElement *self,
                                             GdomeException *exc);
void        gdome_el_set_nodeValue          (GdomeElement *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_el_nodeType            (GdomeElement *self,
                                             GdomeException *exc);
GdomeNode*  gdome_el_parentNode             (GdomeElement *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_el_childNodes          (GdomeElement *self,
                                             GdomeException *exc);
GdomeNode*  gdome_el_firstChild             (GdomeElement *self,
                                             GdomeException *exc);
GdomeNode*  gdome_el_lastChild              (GdomeElement *self,
                                             GdomeException *exc);
GdomeNode*  gdome_el_previousSibling        (GdomeElement *self,
                                             GdomeException *exc);
GdomeNode*  gdome_el_nextSibling            (GdomeElement *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_el_attributes      (GdomeElement *self,
                                             GdomeException *exc);
GdomeDocument* gdome_el_ownerDocument       (GdomeElement *self,
                                             GdomeException *exc);
GdomeNode*  gdome_el_insertBefore           (GdomeElement *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_el_replaceChild           (GdomeElement *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_el_removeChild            (GdomeElement *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_el_appendChild            (GdomeElement *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_el_hasChildNodes         (GdomeElement *self,
                                             GdomeException *exc);
GdomeNode*  gdome_el_cloneNode              (GdomeElement *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_el_normalize              (GdomeElement *self,
                                             GdomeException *exc);
GdomeBoolean gdome_el_isSupported           (GdomeElement *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_el_namespaceURI       (GdomeElement *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_el_prefix             (GdomeElement *self,
                                             GdomeException *exc);
void        gdome_el_set_prefix             (GdomeElement *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_el_localName          (GdomeElement *self,
                                             GdomeException *exc);
GdomeBoolean gdome_el_hasAttributes         (GdomeElement *self,
                                             GdomeException *exc);
void        gdome_el_addEventListener       (GdomeElement *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_el_removeEventListener    (GdomeElement *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_el_dispatchEvent         (GdomeElement *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_el_subTreeDispatchEvent   (GdomeElement *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_el_canAppend             (GdomeElement *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

The GdomeElement interface represents an element in an HTML or XML document. Elements may have attributes associated with them; since the GdomeElement interface inherits from GdomeNode, the generic GdomeNode interface method gdome_el_attributes() may be used to retrieve the set of all attributes for an element. There are methods on the GdomeElement interface to retrieve either an GdomeAttr object by name or an attribute value by name. In XML, where an attribute value may contain entity references, an GdomeAttr object should be retrieved to examine the possibly fairly complex sub-tree representing the attribute value. On the other hand, in HTML, where all attributes have simple string values, methods to directly access an attribute value can safely be used as a convenience.

Details

struct GdomeElement

struct GdomeElement {
	gpointer user_data;
};




gdome_el_setAttribute ()

void        gdome_el_setAttribute           (GdomeElement *self,
                                             GdomeDOMString *name,
                                             GdomeDOMString *value,
                                             GdomeException *exc);

Adds a new attribute. If an attribute with that name is already present in the element, its value is changed to be that of the value parameter.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.


gdome_el_removeAttribute ()

void        gdome_el_removeAttribute        (GdomeElement *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);

Removes an attribute by name. If the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable. To remove an attribute by local name and namespace URI, use the gdome_el_removeAttributeNS() function.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.


gdome_el_getAttributeNode ()

GdomeAttr*  gdome_el_getAttributeNode       (GdomeElement *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);

Retrieves an attribute node by name. To retrieve an attribute node by qualified name and namespace URI, use the gdome_el_getAttributeNodeNS() method.


gdome_el_setAttributeNode ()

GdomeAttr*  gdome_el_setAttributeNode       (GdomeElement *self,
                                             GdomeAttr *newAttr,
                                             GdomeException *exc);

Adds a new attribute node. If an attribute with that name is already present in the element, it is replaced by the new one. To add a new attribute node with a qualified name and namespace URI, use the gdome_el_setAttributeNodeNS() method.

GDOME_WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. GDOME_INUSE_ATTRIBUTE_ERR: Raised if newAttr is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.


gdome_el_removeAttributeNode ()

GdomeAttr*  gdome_el_removeAttributeNode    (GdomeElement *self,
                                             GdomeAttr *oldAttr,
                                             GdomeException *exc);

Removes the specified attribute node. If the removed Attr has a default value it is immediately replaced. The replacing attribute has the same namespace URI and local name, as well as the original prefix, when applicable.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. GDOME_NOT_FOUND_ERR: Raised if oldAttr is not an attribute of the element.




gdome_el_setAttributeNS ()

void        gdome_el_setAttributeNS         (GdomeElement *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *qualifiedName,
                                             GdomeDOMString *value,
                                             GdomeException *exc);

Adds a new attribute. If an attribute with the same namespaceURI and localName is already present in the element, its value is changed to be that of the value parameter.

GDOME_NAMESPACE_ERR: Raised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is NULL, if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace", or if the qualifiedName is "xmlns" and the namespaceURI is different from "http://www.w3.org/2000/xmlns/". GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.


gdome_el_removeAttributeNS ()

void        gdome_el_removeAttributeNS      (GdomeElement *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *localName,
                                             GdomeException *exc);

Removes an attribute by local name and namespace URI. If the removed attribute has a default value it is immediately replaced. The replacing attribute has the same namespace URI and local name, as well as the original prefix.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.



gdome_el_setAttributeNodeNS ()

GdomeAttr*  gdome_el_setAttributeNodeNS     (GdomeElement *self,
                                             GdomeAttr *newAttr,
                                             GdomeException *exc);

Adds a new attribute. If an attribute with that local name and that namespace URI is already present in the element, it is replaced by the new one.

GDOME_WRONG_DOCUMENT_ERR: Raised if newAttr was created from a different document than the one that created the element. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. GDOME_INUSE_ATTRIBUTE_ERR: Raised if newAttr is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.





gdome_el_ref ()

void        gdome_el_ref                    (GdomeElement *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_el_unref ()

void        gdome_el_unref                  (GdomeElement *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_el_set_nodeValue ()

void        gdome_el_set_nodeValue          (GdomeElement *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_el_insertBefore ()

GdomeNode*  gdome_el_insertBefore           (GdomeElement *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_el_replaceChild ()

GdomeNode*  gdome_el_replaceChild           (GdomeElement *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_el_removeChild ()

GdomeNode*  gdome_el_removeChild            (GdomeElement *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_el_appendChild ()

GdomeNode*  gdome_el_appendChild            (GdomeElement *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_el_cloneNode ()

GdomeNode*  gdome_el_cloneNode              (GdomeElement *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_el_normalize ()

void        gdome_el_normalize              (GdomeElement *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_el_set_prefix ()

void        gdome_el_set_prefix             (GdomeElement *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_el_addEventListener ()

void        gdome_el_addEventListener       (GdomeElement *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_el_removeEventListener ()

void        gdome_el_removeEventListener    (GdomeElement *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_el_dispatchEvent ()

GdomeBoolean gdome_el_dispatchEvent         (GdomeElement *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_el_subTreeDispatchEvent ()

void        gdome_el_subTreeDispatchEvent   (GdomeElement *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomeentity.html0000664000076400007640000025074007727712765015311 GdomeEntity

GdomeEntity

Name

GdomeEntity -- Interface Entity implementation.

Synopsis



struct      GdomeEntity;
GdomeDOMString* gdome_ent_publicId          (GdomeEntity *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_ent_systemId          (GdomeEntity *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_ent_notationName      (GdomeEntity *self,
                                             GdomeException *exc);
void        gdome_ent_ref                   (GdomeEntity *self,
                                             GdomeException *exc);
void        gdome_ent_unref                 (GdomeEntity *self,
                                             GdomeException *exc);
gpointer    gdome_ent_query_interface       (GdomeEntity *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_ent_nodeName          (GdomeEntity *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_ent_nodeValue         (GdomeEntity *self,
                                             GdomeException *exc);
void        gdome_ent_set_nodeValue         (GdomeEntity *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_ent_nodeType           (GdomeEntity *self,
                                             GdomeException *exc);
GdomeNode*  gdome_ent_parentNode            (GdomeEntity *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_ent_childNodes         (GdomeEntity *self,
                                             GdomeException *exc);
GdomeNode*  gdome_ent_firstChild            (GdomeEntity *self,
                                             GdomeException *exc);
GdomeNode*  gdome_ent_lastChild             (GdomeEntity *self,
                                             GdomeException *exc);
GdomeNode*  gdome_ent_previousSibling       (GdomeEntity *self,
                                             GdomeException *exc);
GdomeNode*  gdome_ent_nextSibling           (GdomeEntity *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_ent_attributes     (GdomeEntity *self,
                                             GdomeException *exc);
GdomeDocument* gdome_ent_ownerDocument      (GdomeEntity *self,
                                             GdomeException *exc);
GdomeNode*  gdome_ent_insertBefore          (GdomeEntity *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_ent_replaceChild          (GdomeEntity *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_ent_removeChild           (GdomeEntity *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_ent_appendChild           (GdomeEntity *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_ent_hasChildNodes        (GdomeEntity *self,
                                             GdomeException *exc);
GdomeNode*  gdome_ent_cloneNode             (GdomeEntity *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_ent_normalize             (GdomeEntity *self,
                                             GdomeException *exc);
GdomeBoolean gdome_ent_isSupported          (GdomeEntity *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_ent_namespaceURI      (GdomeEntity *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_ent_prefix            (GdomeEntity *self,
                                             GdomeException *exc);
void        gdome_ent_set_prefix            (GdomeEntity *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_ent_localName         (GdomeEntity *self,
                                             GdomeException *exc);
GdomeBoolean gdome_ent_hasAttributes        (GdomeEntity *self,
                                             GdomeException *exc);
void        gdome_ent_addEventListener      (GdomeEntity *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_ent_removeEventListener   (GdomeEntity *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_ent_dispatchEvent        (GdomeEntity *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_ent_subTreeDispatchEvent  (GdomeEntity *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_ent_canAppend            (GdomeEntity *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

This interface represents an entity, either parsed or unparsed, in an XML document. Note that this models the entity itself not the entity declaration.

The gdome_ent_nodeName() method that is inherited from GdomeNode contains the name of the entity.

An XML processor may choose to completely expand entities before the structure model is passed to the DOM; in this case there will be no EntityReference nodes in the document tree. You can do that with the GDOME_LOAD_SUBSTITUTE_ENTITIES flag in methods that load document (i.e. gdome_di_createDocFromUri()).

The DOM Level 2 does not support editing GdomeEntity nodes; if a user wants to make changes to the contents of an GdomeEntity, every related GdomeEntityReference node has to be replaced in the structure model by a clone of the GdomeEntity 's contents, and then the desired changes must be made to each of those clones instead. GdomeEntity nodes and all their descendants are readonly.

An GdomeEntity node does not have any parent.

Details

struct GdomeEntity

struct GdomeEntity {
	gpointer user_data;
};





gdome_ent_ref ()

void        gdome_ent_ref                   (GdomeEntity *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_ent_unref ()

void        gdome_ent_unref                 (GdomeEntity *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_ent_set_nodeValue ()

void        gdome_ent_set_nodeValue         (GdomeEntity *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_ent_insertBefore ()

GdomeNode*  gdome_ent_insertBefore          (GdomeEntity *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_ent_replaceChild ()

GdomeNode*  gdome_ent_replaceChild          (GdomeEntity *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_ent_removeChild ()

GdomeNode*  gdome_ent_removeChild           (GdomeEntity *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_ent_appendChild ()

GdomeNode*  gdome_ent_appendChild           (GdomeEntity *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_ent_cloneNode ()

GdomeNode*  gdome_ent_cloneNode             (GdomeEntity *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_ent_normalize ()

void        gdome_ent_normalize             (GdomeEntity *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_ent_set_prefix ()

void        gdome_ent_set_prefix            (GdomeEntity *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_ent_addEventListener ()

void        gdome_ent_addEventListener      (GdomeEntity *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_ent_removeEventListener ()

void        gdome_ent_removeEventListener   (GdomeEntity *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_ent_dispatchEvent ()

GdomeBoolean gdome_ent_dispatchEvent        (GdomeEntity *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_ent_subTreeDispatchEvent ()

void        gdome_ent_subTreeDispatchEvent  (GdomeEntity *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomeentityreference.html0000664000076400007640000023772607727712765017201 GdomeEntityReference

GdomeEntityReference

Name

GdomeEntityReference -- Interface EntityReference implementation.

Synopsis



struct      GdomeEntityReference;
void        gdome_er_ref                    (GdomeEntityReference *self,
                                             GdomeException *exc);
void        gdome_er_unref                  (GdomeEntityReference *self,
                                             GdomeException *exc);
gpointer    gdome_er_query_interface        (GdomeEntityReference *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_er_nodeName           (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_er_nodeValue          (GdomeEntityReference *self,
                                             GdomeException *exc);
void        gdome_er_set_nodeValue          (GdomeEntityReference *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_er_nodeType            (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeNode*  gdome_er_parentNode             (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_er_childNodes          (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeNode*  gdome_er_firstChild             (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeNode*  gdome_er_lastChild              (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeNode*  gdome_er_previousSibling        (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeNode*  gdome_er_nextSibling            (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_er_attributes      (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeDocument* gdome_er_ownerDocument       (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeNode*  gdome_er_insertBefore           (GdomeEntityReference *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_er_replaceChild           (GdomeEntityReference *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_er_removeChild            (GdomeEntityReference *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_er_appendChild            (GdomeEntityReference *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_er_hasChildNodes         (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeNode*  gdome_er_cloneNode              (GdomeEntityReference *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_er_normalize              (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeBoolean gdome_er_isSupported           (GdomeEntityReference *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_er_namespaceURI       (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_er_prefix             (GdomeEntityReference *self,
                                             GdomeException *exc);
void        gdome_er_set_prefix             (GdomeEntityReference *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_er_localName          (GdomeEntityReference *self,
                                             GdomeException *exc);
GdomeBoolean gdome_er_hasAttributes         (GdomeEntityReference *self,
                                             GdomeException *exc);
void        gdome_er_addEventListener       (GdomeEntityReference *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_er_removeEventListener    (GdomeEntityReference *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_er_dispatchEvent         (GdomeEntityReference *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_er_subTreeDispatchEvent   (GdomeEntityReference *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_er_canAppend             (GdomeEntityReference *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

GdomeEntityReference objects may be inserted into the structure model when an entity reference is in the source document, or when the user wishes to insert an entity reference.

As for GdomeEntity nodes, GdomeEntityReference nodes and all their descendants are readonly.

Details

struct GdomeEntityReference

struct GdomeEntityReference {
	gpointer user_data;
};


gdome_er_ref ()

void        gdome_er_ref                    (GdomeEntityReference *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_er_unref ()

void        gdome_er_unref                  (GdomeEntityReference *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_er_set_nodeValue ()

void        gdome_er_set_nodeValue          (GdomeEntityReference *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_er_insertBefore ()

GdomeNode*  gdome_er_insertBefore           (GdomeEntityReference *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_er_replaceChild ()

GdomeNode*  gdome_er_replaceChild           (GdomeEntityReference *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_er_removeChild ()

GdomeNode*  gdome_er_removeChild            (GdomeEntityReference *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_er_appendChild ()

GdomeNode*  gdome_er_appendChild            (GdomeEntityReference *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_er_cloneNode ()

GdomeNode*  gdome_er_cloneNode              (GdomeEntityReference *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_er_normalize ()

void        gdome_er_normalize              (GdomeEntityReference *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_er_set_prefix ()

void        gdome_er_set_prefix             (GdomeEntityReference *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_er_addEventListener ()

void        gdome_er_addEventListener       (GdomeEntityReference *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_er_removeEventListener ()

void        gdome_er_removeEventListener    (GdomeEntityReference *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_er_dispatchEvent ()

GdomeBoolean gdome_er_dispatchEvent         (GdomeEntityReference *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_er_subTreeDispatchEvent ()

void        gdome_er_subTreeDispatchEvent   (GdomeEntityReference *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomenamednodemap.html0000664000076400007640000007647507727712765016440 GdomeNamedNodeMap

GdomeNamedNodeMap

Name

GdomeNamedNodeMap -- Interface NamedNodeMap implementation.

Description

Objects implementing the GdomeNamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that GdomeNamedNodeMap does not inherit from GdomeNodeList; GdomeNamedNodeMap are not maintained in any particular order. Objects contained in an object implementing GdomeNamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a GdomeNamedNodeMap, and does not imply that the DOM specifies an order to these Nodes.

GdomeNamedNodeMap objects in the DOM are live.

Details

struct GdomeNamedNodeMap

struct GdomeNamedNodeMap {
	gpointer user_data;
};


gdome_nnm_ref ()

void        gdome_nnm_ref                   (GdomeNamedNodeMap *self,
                                             GdomeException *exc);

Increase the reference count of the specified NamedNodeMap.


gdome_nnm_unref ()

void        gdome_nnm_unref                 (GdomeNamedNodeMap *self,
                                             GdomeException *exc);

Decrease the reference count of the specified NamedNodeMap. Free the NamedNodeMap structure if the specified NamedNodeMap will have zero reference.




gdome_nnm_setNamedItem ()

GdomeNode*  gdome_nnm_setNamedItem          (GdomeNamedNodeMap *self,
                                             GdomeNode *arg,
                                             GdomeException *exc);

Adds a node using its nodeName attribute. If a node with that name is already present in this map, it is replaced by the new one.

GDOME_WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. GDOME_INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.


gdome_nnm_removeNamedItem ()

GdomeNode*  gdome_nnm_removeNamedItem       (GdomeNamedNodeMap *self,
                                             GdomeDOMString *name,
                                             GdomeException *exc);

Removes a node specified by name. When this map contains the attributes attached to an element, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable.

GDOME_NOT_FOUND_ERR: Raised if there is no node named name in this map. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.





gdome_nnm_setNamedItemNS ()

GdomeNode*  gdome_nnm_setNamedItemNS        (GdomeNamedNodeMap *self,
                                             GdomeNode *arg,
                                             GdomeException *exc);

Adds a node using its namespaceURI and localName. If a node with that namespace URI and that local name is already present in this map, it is replaced by the new one

GDOME_WRONG_DOCUMENT_ERR: Raised if arg was created from a different document than the one that created this map. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly. GDOME_INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an attribute of another Element object. The DOM user must explicitly clone Attr nodes to re-use them in other elements.


gdome_nnm_removeNamedItemNS ()

GdomeNode*  gdome_nnm_removeNamedItemNS     (GdomeNamedNodeMap *self,
                                             GdomeDOMString *namespaceURI,
                                             GdomeDOMString *localName,
                                             GdomeException *exc);

Removes a node specified by local name and namespace URI. When this map contains the attributes attached to an element, if the removed attribute is known to have a default value, an attribute immediately appears containing the default value as well as the corresponding namespace URI, local name, and prefix when applicable.

GDOME_NOT_FOUND_ERR: Raised if there is no node named name in this map. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.

gdome2-0.8.1/gtk-doc/html/gdome2-gdomenode.html0000664000076400007640000023441507727712765014723 GdomeNode

GdomeNode

Name

GdomeNode -- Interface Node implementation.

Synopsis



struct      GdomeNode;
void        gdome_n_ref                     (GdomeNode *self,
                                             GdomeException *exc);
void        gdome_n_unref                   (GdomeNode *self,
                                             GdomeException *exc);
gpointer    gdome_n_query_interface         (GdomeNode *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_n_nodeName            (GdomeNode *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_n_nodeValue           (GdomeNode *self,
                                             GdomeException *exc);
void        gdome_n_set_nodeValue           (GdomeNode *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_n_nodeType             (GdomeNode *self,
                                             GdomeException *exc);
GdomeNode*  gdome_n_parentNode              (GdomeNode *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_n_childNodes           (GdomeNode *self,
                                             GdomeException *exc);
GdomeNode*  gdome_n_firstChild              (GdomeNode *self,
                                             GdomeException *exc);
GdomeNode*  gdome_n_lastChild               (GdomeNode *self,
                                             GdomeException *exc);
GdomeNode*  gdome_n_previousSibling         (GdomeNode *self,
                                             GdomeException *exc);
GdomeNode*  gdome_n_nextSibling             (GdomeNode *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_n_attributes       (GdomeNode *self,
                                             GdomeException *exc);
GdomeDocument* gdome_n_ownerDocument        (GdomeNode *self,
                                             GdomeException *exc);
GdomeNode*  gdome_n_insertBefore            (GdomeNode *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_n_replaceChild            (GdomeNode *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_n_removeChild             (GdomeNode *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_n_appendChild             (GdomeNode *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_n_hasChildNodes          (GdomeNode *self,
                                             GdomeException *exc);
GdomeNode*  gdome_n_cloneNode               (GdomeNode *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_n_normalize               (GdomeNode *self,
                                             GdomeException *exc);
GdomeBoolean gdome_n_isSupported            (GdomeNode *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_n_namespaceURI        (GdomeNode *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_n_prefix              (GdomeNode *self,
                                             GdomeException *exc);
void        gdome_n_set_prefix              (GdomeNode *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_n_localName           (GdomeNode *self,
                                             GdomeException *exc);
GdomeBoolean gdome_n_hasAttributes          (GdomeNode *self,
                                             GdomeException *exc);
void        gdome_n_addEventListener        (GdomeNode *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_n_removeEventListener     (GdomeNode *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_n_dispatchEvent          (GdomeNode *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_n_subTreeDispatchEvent    (GdomeNode *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_n_canAppend              (GdomeNode *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

The GdomeNode interface is the primary datatype for the entire Document Object Model. It represents a single node in the document tree. While all objects implementing the GdomeNode interface expose methods for dealing with children, not all objects implementing the GdomeNode interface may have children. For example, GdomeText nodes may not have children, and adding children to such nodes results in a GdomeDOMException being raised.

The methods gdome_n_nodeName(), gdome_n_nodeValue() and gdome_n_attributes() are included as a mechanism to get at node information without casting down to the specific derived interface. In cases where there is no obvious mapping of these attributes for a specific nodeType (e.g., gdome_n_nodeValue() for a GdomeElement or gdome_n_attributes() for a GdomeComment), this returns NULL. Note that the specialized interfaces may contain additional and more convenient mechanisms to get and set the relevant information.

Details

struct GdomeNode

struct GdomeNode {
	gpointer user_data;
};


gdome_n_ref ()

void        gdome_n_ref                     (GdomeNode *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_n_unref ()

void        gdome_n_unref                   (GdomeNode *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_n_set_nodeValue ()

void        gdome_n_set_nodeValue           (GdomeNode *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_n_insertBefore ()

GdomeNode*  gdome_n_insertBefore            (GdomeNode *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_n_replaceChild ()

GdomeNode*  gdome_n_replaceChild            (GdomeNode *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_n_removeChild ()

GdomeNode*  gdome_n_removeChild             (GdomeNode *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_n_appendChild ()

GdomeNode*  gdome_n_appendChild             (GdomeNode *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_n_cloneNode ()

GdomeNode*  gdome_n_cloneNode               (GdomeNode *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_n_normalize ()

void        gdome_n_normalize               (GdomeNode *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_n_set_prefix ()

void        gdome_n_set_prefix              (GdomeNode *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_n_addEventListener ()

void        gdome_n_addEventListener        (GdomeNode *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_n_removeEventListener ()

void        gdome_n_removeEventListener     (GdomeNode *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_n_dispatchEvent ()

GdomeBoolean gdome_n_dispatchEvent          (GdomeNode *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_n_subTreeDispatchEvent ()

void        gdome_n_subTreeDispatchEvent    (GdomeNode *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomenodelist.html0000664000076400007640000003167607727712765015623 GdomeNodeList

GdomeNodeList

Name

GdomeNodeList -- Interface NodeList implementation.

Description

The GdomeNodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. GdomeNodeList objects in the DOM are live.

The items in the GdomeNodeList are accessible via an integral index, starting from 0.

Details

struct GdomeNodeList

struct GdomeNodeList {
	gpointer user_data;
};


gdome_nl_ref ()

void        gdome_nl_ref                    (GdomeNodeList *self,
                                             GdomeException *exc);

Increase the reference count of the specified NodeList.


gdome_nl_unref ()

void        gdome_nl_unref                  (GdomeNodeList *self,
                                             GdomeException *exc);

Decrease the reference count of the specified NodeList. Free the NodeList structure if the specified NodeList will have zero reference.




gdome2-0.8.1/gtk-doc/html/gdome2-gdomenotation.html0000664000076400007640000024436407727712765015635 GdomeNotation

GdomeNotation

Name

GdomeNotation -- Interface Notation implementation.

Synopsis



struct      GdomeNotation;
GdomeDOMString* gdome_not_publicId          (GdomeNotation *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_not_systemId          (GdomeNotation *self,
                                             GdomeException *exc);
void        gdome_not_ref                   (GdomeNotation *self,
                                             GdomeException *exc);
void        gdome_not_unref                 (GdomeNotation *self,
                                             GdomeException *exc);
gpointer    gdome_not_query_interface       (GdomeNotation *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_not_nodeName          (GdomeNotation *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_not_nodeValue         (GdomeNotation *self,
                                             GdomeException *exc);
void        gdome_not_set_nodeValue         (GdomeNotation *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_not_nodeType           (GdomeNotation *self,
                                             GdomeException *exc);
GdomeNode*  gdome_not_parentNode            (GdomeNotation *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_not_childNodes         (GdomeNotation *self,
                                             GdomeException *exc);
GdomeNode*  gdome_not_firstChild            (GdomeNotation *self,
                                             GdomeException *exc);
GdomeNode*  gdome_not_lastChild             (GdomeNotation *self,
                                             GdomeException *exc);
GdomeNode*  gdome_not_previousSibling       (GdomeNotation *self,
                                             GdomeException *exc);
GdomeNode*  gdome_not_nextSibling           (GdomeNotation *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_not_attributes     (GdomeNotation *self,
                                             GdomeException *exc);
GdomeDocument* gdome_not_ownerDocument      (GdomeNotation *self,
                                             GdomeException *exc);
GdomeNode*  gdome_not_insertBefore          (GdomeNotation *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_not_replaceChild          (GdomeNotation *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_not_removeChild           (GdomeNotation *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_not_appendChild           (GdomeNotation *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_not_hasChildNodes        (GdomeNotation *self,
                                             GdomeException *exc);
GdomeNode*  gdome_not_cloneNode             (GdomeNotation *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_not_normalize             (GdomeNotation *self,
                                             GdomeException *exc);
GdomeBoolean gdome_not_isSupported          (GdomeNotation *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_not_namespaceURI      (GdomeNotation *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_not_prefix            (GdomeNotation *self,
                                             GdomeException *exc);
void        gdome_not_set_prefix            (GdomeNotation *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_not_localName         (GdomeNotation *self,
                                             GdomeException *exc);
GdomeBoolean gdome_not_hasAttributes        (GdomeNotation *self,
                                             GdomeException *exc);
void        gdome_not_addEventListener      (GdomeNotation *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_not_removeEventListener   (GdomeNotation *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_not_dispatchEvent        (GdomeNotation *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_not_subTreeDispatchEvent  (GdomeNotation *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_not_canAppend            (GdomeNotation *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

This interface represents a notation declared in the DTD. A notation either declares, by name, the format of an unparsed entity (see section 4.7 of the XML 1.0 specification), or is used for formal declaration of processing instruction targets (see section 2.6 of the XML 1.0 specification). The gdome_not_nodeName() method inherited from GdomeNode is set to the declared name of the notation.

The DOM Level 2 does not support editing GdomeNotation nodes; they are therefore readonly.

A GdomeNotation node does not have any parent.

Details

struct GdomeNotation

struct GdomeNotation {
	gpointer user_data;
};




gdome_not_ref ()

void        gdome_not_ref                   (GdomeNotation *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_not_unref ()

void        gdome_not_unref                 (GdomeNotation *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_not_set_nodeValue ()

void        gdome_not_set_nodeValue         (GdomeNotation *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_not_insertBefore ()

GdomeNode*  gdome_not_insertBefore          (GdomeNotation *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_not_replaceChild ()

GdomeNode*  gdome_not_replaceChild          (GdomeNotation *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_not_removeChild ()

GdomeNode*  gdome_not_removeChild           (GdomeNotation *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_not_appendChild ()

GdomeNode*  gdome_not_appendChild           (GdomeNotation *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_not_cloneNode ()

GdomeNode*  gdome_not_cloneNode             (GdomeNotation *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_not_normalize ()

void        gdome_not_normalize             (GdomeNotation *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_not_set_prefix ()

void        gdome_not_set_prefix            (GdomeNotation *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_not_addEventListener ()

void        gdome_not_addEventListener      (GdomeNotation *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_not_removeEventListener ()

void        gdome_not_removeEventListener   (GdomeNotation *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_not_dispatchEvent ()

GdomeBoolean gdome_not_dispatchEvent        (GdomeNotation *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_not_subTreeDispatchEvent ()

void        gdome_not_subTreeDispatchEvent  (GdomeNotation *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdomeprocessinginstruction.html0000664000076400007640000025612607727712765020457 GdomeProcessingInstruction

GdomeProcessingInstruction

Name

GdomeProcessingInstruction -- Interface ProcessingInstruction implementation.

Synopsis



struct      GdomeProcessingInstruction;
GdomeDOMString* gdome_pi_target             (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_pi_data               (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
void        gdome_pi_set_data               (GdomeProcessingInstruction *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);
void        gdome_pi_ref                    (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
void        gdome_pi_unref                  (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
gpointer    gdome_pi_query_interface        (GdomeProcessingInstruction *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_pi_nodeName           (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_pi_nodeValue          (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
void        gdome_pi_set_nodeValue          (GdomeProcessingInstruction *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_pi_nodeType            (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeNode*  gdome_pi_parentNode             (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_pi_childNodes          (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeNode*  gdome_pi_firstChild             (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeNode*  gdome_pi_lastChild              (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeNode*  gdome_pi_previousSibling        (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeNode*  gdome_pi_nextSibling            (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_pi_attributes      (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeDocument* gdome_pi_ownerDocument       (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeNode*  gdome_pi_insertBefore           (GdomeProcessingInstruction *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_pi_replaceChild           (GdomeProcessingInstruction *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_pi_removeChild            (GdomeProcessingInstruction *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_pi_appendChild            (GdomeProcessingInstruction *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_pi_hasChildNodes         (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeNode*  gdome_pi_cloneNode              (GdomeProcessingInstruction *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_pi_normalize              (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeBoolean gdome_pi_isSupported           (GdomeProcessingInstruction *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_pi_namespaceURI       (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_pi_prefix             (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
void        gdome_pi_set_prefix             (GdomeProcessingInstruction *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_pi_localName          (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
GdomeBoolean gdome_pi_hasAttributes         (GdomeProcessingInstruction *self,
                                             GdomeException *exc);
void        gdome_pi_addEventListener       (GdomeProcessingInstruction *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_pi_removeEventListener    (GdomeProcessingInstruction *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_pi_dispatchEvent         (GdomeProcessingInstruction *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_pi_subTreeDispatchEvent   (GdomeProcessingInstruction *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_pi_canAppend             (GdomeProcessingInstruction *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

The GdomeProcessingInstruction interface represents a "processing instruction", used in XML as a way to keep processor-specific information in the text of the document.

Details

struct GdomeProcessingInstruction

struct GdomeProcessingInstruction {
	gpointer user_data;
};




gdome_pi_set_data ()

void        gdome_pi_set_data               (GdomeProcessingInstruction *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);

Set the content of this processing instruction.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_pi_ref ()

void        gdome_pi_ref                    (GdomeProcessingInstruction *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_pi_unref ()

void        gdome_pi_unref                  (GdomeProcessingInstruction *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_pi_set_nodeValue ()

void        gdome_pi_set_nodeValue          (GdomeProcessingInstruction *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_pi_insertBefore ()

GdomeNode*  gdome_pi_insertBefore           (GdomeProcessingInstruction *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_pi_replaceChild ()

GdomeNode*  gdome_pi_replaceChild           (GdomeProcessingInstruction *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_pi_removeChild ()

GdomeNode*  gdome_pi_removeChild            (GdomeProcessingInstruction *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_pi_appendChild ()

GdomeNode*  gdome_pi_appendChild            (GdomeProcessingInstruction *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_pi_cloneNode ()

GdomeNode*  gdome_pi_cloneNode              (GdomeProcessingInstruction *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_pi_normalize ()

void        gdome_pi_normalize              (GdomeProcessingInstruction *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_pi_set_prefix ()

void        gdome_pi_set_prefix             (GdomeProcessingInstruction *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_pi_addEventListener ()

void        gdome_pi_addEventListener       (GdomeProcessingInstruction *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_pi_removeEventListener ()

void        gdome_pi_removeEventListener    (GdomeProcessingInstruction *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_pi_dispatchEvent ()

GdomeBoolean gdome_pi_dispatchEvent         (GdomeProcessingInstruction *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_pi_subTreeDispatchEvent ()

void        gdome_pi_subTreeDispatchEvent   (GdomeProcessingInstruction *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-gdometext.html0000664000076400007640000031000607727712765014751 GdomeText

GdomeText

Name

GdomeText -- Interface Text implementation

Synopsis



struct      GdomeText;
GdomeText*  gdome_t_splitText               (GdomeText *self,
                                             gulong offset,
                                             GdomeException *exc);
GdomeDOMString* gdome_t_data                (GdomeText *self,
                                             GdomeException *exc);
void        gdome_t_set_data                (GdomeText *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);
gulong      gdome_t_length                  (GdomeText *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_t_substringData       (GdomeText *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);
void        gdome_t_appendData              (GdomeText *self,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_t_insertData              (GdomeText *self,
                                             gulong offset,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_t_deleteData              (GdomeText *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);
void        gdome_t_replaceData             (GdomeText *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);
void        gdome_t_ref                     (GdomeText *self,
                                             GdomeException *exc);
void        gdome_t_unref                   (GdomeText *self,
                                             GdomeException *exc);
gpointer    gdome_t_query_interface         (GdomeText *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeDOMString* gdome_t_nodeName            (GdomeText *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_t_nodeValue           (GdomeText *self,
                                             GdomeException *exc);
void        gdome_t_set_nodeValue           (GdomeText *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);
unsigned short gdome_t_nodeType             (GdomeText *self,
                                             GdomeException *exc);
GdomeNode*  gdome_t_parentNode              (GdomeText *self,
                                             GdomeException *exc);
GdomeNodeList* gdome_t_childNodes           (GdomeText *self,
                                             GdomeException *exc);
GdomeNode*  gdome_t_firstChild              (GdomeText *self,
                                             GdomeException *exc);
GdomeNode*  gdome_t_lastChild               (GdomeText *self,
                                             GdomeException *exc);
GdomeNode*  gdome_t_previousSibling         (GdomeText *self,
                                             GdomeException *exc);
GdomeNode*  gdome_t_nextSibling             (GdomeText *self,
                                             GdomeException *exc);
GdomeNamedNodeMap* gdome_t_attributes       (GdomeText *self,
                                             GdomeException *exc);
GdomeDocument* gdome_t_ownerDocument        (GdomeText *self,
                                             GdomeException *exc);
GdomeNode*  gdome_t_insertBefore            (GdomeText *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);
GdomeNode*  gdome_t_replaceChild            (GdomeText *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_t_removeChild             (GdomeText *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);
GdomeNode*  gdome_t_appendChild             (GdomeText *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);
GdomeBoolean gdome_t_hasChildNodes          (GdomeText *self,
                                             GdomeException *exc);
GdomeNode*  gdome_t_cloneNode               (GdomeText *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);
void        gdome_t_normalize               (GdomeText *self,
                                             GdomeException *exc);
GdomeBoolean gdome_t_isSupported            (GdomeText *self,
                                             GdomeDOMString *feature,
                                             GdomeDOMString *version,
                                             GdomeException *exc);
GdomeDOMString* gdome_t_namespaceURI        (GdomeText *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_t_prefix              (GdomeText *self,
                                             GdomeException *exc);
void        gdome_t_set_prefix              (GdomeText *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);
GdomeDOMString* gdome_t_localName           (GdomeText *self,
                                             GdomeException *exc);
GdomeBoolean gdome_t_hasAttributes          (GdomeText *self,
                                             GdomeException *exc);
void        gdome_t_addEventListener        (GdomeText *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
void        gdome_t_removeEventListener     (GdomeText *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);
GdomeBoolean gdome_t_dispatchEvent          (GdomeText *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
void        gdome_t_subTreeDispatchEvent    (GdomeText *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);
GdomeBoolean gdome_t_canAppend              (GdomeText *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Description

The GdomeText interface inherits from GdomeCharacterData and represents the textual content (termed character data in XML) of an GdomeElement or GdomeAttr. If there is no markup inside an element's content, the text is contained in a single object implementing the GdomeText interface that is the only child of the element. If there is markup, it is parsed into the information items (elements, comments, etc.) and GdomeText nodes that form the list of children of the element.

When a document is first made available via the Gdome2, there is only one GdomeText node for each block of text. Users may create adjacent GdomeText nodes that represent the contents of a given element without any intervening markup, but should be aware that there is no way to represent the separations between these nodes in XML or HTML, so they will not (in general) persist between DOM editing sessions. The gdome_n_normalize() method on GdomeNode merges any such adjacent GdomeText objects into a single node for each block of text.

Details

struct GdomeText

struct GdomeText {
	gpointer user_data;
};


gdome_t_splitText ()

GdomeText*  gdome_t_splitText               (GdomeText *self,
                                             gulong offset,
                                             GdomeException *exc);

Breaks this node into two nodes at the specified offset, keeping both in the tree as siblings. After being split, this node will contain all the content up to the offset point. A new node of the same type, which contains all the content at and after the offset point, is returned. If the original node had a parent node, the new node is inserted as the next sibling of the original node. When the offset is equal to the length of this node, the new node has no data.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.



gdome_t_set_data ()

void        gdome_t_set_data                (GdomeText *self,
                                             GdomeDOMString *data,
                                             GdomeException *exc);

Sets the data value of this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_t_substringData ()

GdomeDOMString* gdome_t_substringData       (GdomeText *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);

Extracts a range of data from the node.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data.


gdome_t_appendData ()

void        gdome_t_appendData              (GdomeText *self,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Append the string to the end of the character data of the node. Upon success, data provides access to the concatenation of data and the string specified.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_t_insertData ()

void        gdome_t_insertData              (GdomeText *self,
                                             gulong offset,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Insert a string at the specified 16-bit unit offset.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_t_deleteData ()

void        gdome_t_deleteData              (GdomeText *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeException *exc);

Remove a range of 16-bit units from the node. If the sum of offset and count exceeds length then all 16-bit units from offset to the end of the data are deleted. Upon success, data and length reflect the change.

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_t_replaceData ()

void        gdome_t_replaceData             (GdomeText *self,
                                             gulong offset,
                                             gulong count,
                                             GdomeDOMString *arg,
                                             GdomeException *exc);

Replace the characters starting at the specified 16-bit unit offset with the specified string. If the sum of offset and count exceeds length, then all 16-bit units to the end of the data are replaced;

GDOME_INDEX_SIZE_ERR: Raised if the specified offset is greater than the number of 16-bit units in data. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_t_ref ()

void        gdome_t_ref                     (GdomeText *self,
                                             GdomeException *exc);

Increase the reference count of the specified Node.


gdome_t_unref ()

void        gdome_t_unref                   (GdomeText *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Node. Free the Node structure if the Node will have zero reference.





gdome_t_set_nodeValue ()

void        gdome_t_set_nodeValue           (GdomeText *self,
                                             GdomeDOMString *nodeValue,
                                             GdomeException *exc);

Sets The value of this node, depending on its type.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.











gdome_t_insertBefore ()

GdomeNode*  gdome_t_insertBefore            (GdomeText *self,
                                             GdomeNode *newChild,
                                             GdomeNode *refChild,
                                             GdomeException *exc);

Inserts the node newChild before the existing child node refChild. If refChild is NULL, insert newChild at the end of the list of children. If newChild is a DocumentFragment node, all of its children are inserted, in the same order, before refChild. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to insert is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if refChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_t_replaceChild ()

GdomeNode*  gdome_t_replaceChild            (GdomeText *self,
                                             GdomeNode *newChild,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Replaces the child node oldChild with newChild in the list of children, and returns the oldChild node. If newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_t_removeChild ()

GdomeNode*  gdome_t_removeChild             (GdomeText *self,
                                             GdomeNode *oldChild,
                                             GdomeException *exc);

Removes the child node indicated by oldChild from the list of children, and returns it.

GDOME_NOT_FOUND_ERR: Raised if oldChild is not a child of this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.


gdome_t_appendChild ()

GdomeNode*  gdome_t_appendChild             (GdomeText *self,
                                             GdomeNode *newChild,
                                             GdomeException *exc);

Adds the node newChild to the end of the list of children of this node. If the newChild is already in the tree, it is first removed. If it is a DocumentFragment node, the entire contents of the document fragment are moved into the child list of this node

GDOME_HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to append is one of this node's ancestors or this node itself. GDOME_WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node. GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.



gdome_t_cloneNode ()

GdomeNode*  gdome_t_cloneNode               (GdomeText *self,
                                             GdomeBoolean deep,
                                             GdomeException *exc);

Makes a duplicate of this node, i.e., serves as a generic copy constructor for nodes. The duplicate node has no parent; (parentNode is NULL). GDOME_DOCUMENT_TYPE_NODE, GDOME_NOTATION_NODE and GDOME_ENTITY_NODE nodes are not supported.

GDOME_NOT_SUPPORTED_ERR: Raised if the type of node being cloned is not supported.


gdome_t_normalize ()

void        gdome_t_normalize               (GdomeText *self,
                                             GdomeException *exc);

Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.





gdome_t_set_prefix ()

void        gdome_t_set_prefix              (GdomeText *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Sets a new nemaspace prefix for this node.

GDOME_NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. GDOME_NAMESPACE_ERR: Raised if the specified prefix is malformed per the Namespaces in XML specification, if the namespaceURI of this node is NULL, if the specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace", if this node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/", or if this node is an attribute and the qualifiedName of this node is "xmlns".




gdome_t_addEventListener ()

void        gdome_t_addEventListener        (GdomeText *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the registration of event listeners on the event target. If an EventListener is added to an EventTarget while it is processing an event, it will not be triggered by the current actions but may be triggered during a later stage of event flow, such as the bubbling phase. If multiple identical EventListeners are registered on the same EventTarget with the same parameters the duplicate instances are discarded. They do not cause the EventListener to be called twice and since they are discarded they do not need to be removed with the removeEventListener method.


gdome_t_removeEventListener ()

void        gdome_t_removeEventListener     (GdomeText *self,
                                             GdomeDOMString *type,
                                             GdomeEventListener *listener,
                                             GdomeBoolean useCapture,
                                             GdomeException *exc);

This method allows the removal of event listeners from the event target. If an EventListener is removed from an EventTarget while it is processing an event, it will not be triggered by the current actions. EventListeners can never be invoked after being removed. Calling removeEventListener with arguments which do not identify any currently registered EventListener on the EventTarget has no effect.


gdome_t_dispatchEvent ()

GdomeBoolean gdome_t_dispatchEvent          (GdomeText *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome_t_subTreeDispatchEvent ()

void        gdome_t_subTreeDispatchEvent    (GdomeText *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method allows the dispatch of events into the implementations event model. Events dispatched in this manner will have the same capturing and bubbling behavior as events dispatched directly by the implementation. The target of the event is any nodes in the subtree of the EventTarget on which dispatchEvent is called.

GDOME_UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified by initializing the event before dispatchEvent was called. Specification of the Event's type as NULL or an empty string will also trigger this exception.


gdome2-0.8.1/gtk-doc/html/gdome2-events-basic-types-and-enumerations.html0000664000076400007640000001627207727712764021754 Events Basic Types and Enumerations

Events Basic Types and Enumerations

Name

Events Basic Types and Enumerations -- Description of basic types, classes and enumeration for "Events" modules.

Description

Details

enum GdomePhaseType

typedef enum {
	GDOME_CAPTURING_PHASE = 1,
	GDOME_AT_TARGET = 2,
	GDOME_BUBBLING_PHASE = 3
} GdomePhaseType;


enum GdomeAttrChangeType

typedef enum {
	GDOME_ADDITION = 1,
	GDOME_MODIFICATION = 2,
	GDOME_REMOVAL = 3
} GdomeAttrChangeType;


enum GdomeEventExceptionCode

typedef enum {
	GDOME_UNSPECIFIED_EVENT_TYPE_ERR = 0
} GdomeEventExceptionCode;


enum GdomeEventType

typedef enum {
	GDOME_BASE_EVENT = 1,
	GDOME_MUTATION_EVENT = 2,
} GdomeEventType;


GdomeEventTarget

typedef GdomeNode GdomeEventTarget;


GDOME_EVNT()

#define GDOME_EVNT(evt) gdome_cast_evnt((GdomeEvent *)evt)

Cast a ganeral GdomeEvent reference to a GdomeEvent one.


GDOME_MEVNT()

#define GDOME_MEVNT(evt) gdome_cast_mevnt((GdomeEvent *)evt)

Cast a ganeral GdomeEvent reference to a GdomeMutationEvent one.

gdome2-0.8.1/gtk-doc/html/gdome2-events.html0000664000076400007640000000625207606515346014252 Events modules

Events modules

Table of Contents
Events Basic Types and Enumerations -- Description of basic types, classes and enumeration for "Events" modules.
GdomeEventListener -- Interface EventListener implementation.
GdomeEvent -- Interface Event implementation.
GdomeMutationEvent -- Interface MutationEvent implementation.
gdome2-0.8.1/gtk-doc/html/gdome2-gdomeevent.html0000664000076400007640000007430107727712765015113 GdomeEvent

GdomeEvent

Name

GdomeEvent -- Interface Event implementation.

Description

The GdomeEvent interface is used to provide contextual information about an event to the handler processing the event. An object which implements the GdomeEvent interface is generally passed as the first parameter to an event handler. More specific context information is passed to event handlers by deriving additional interfaces from GdomeEvent which contain information directly relating to the type of event they accompany. These derived interfaces are also implemented by the object passed to the event listener.

Details

struct GdomeEvent

struct GdomeEvent {
	gpointer user_data;
};



gdome_evnt_ref ()

void        gdome_evnt_ref                  (GdomeEvent *self,
                                             GdomeException *exc);

Increase the reference count of the specified Event.


gdome_evnt_unref ()

void        gdome_evnt_unref                (GdomeEvent *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Event. Free the Event structure if the Event will have zero reference.










gdome_evnt_initEvent ()

void        gdome_evnt_initEvent            (GdomeEvent *self,
                                             GdomeDOMString *eventTypeArg,
                                             GdomeBoolean canBubbleArg,
                                             GdomeBoolean cancelableArg,
                                             GdomeException *exc);

The initEvent method is used to initialize the value of an Event created through the gdome_doc_createEvent() API. This method may only be called before the Event has been dispatched via the dispatchEvent method, though it may be called multiple times during that phase if necessary. If called multiple times the final invocation takes precedence. If called from a subclass of Event interface only the values specified in the initEvent method are modified, all other attributes are left unchanged.


gdome_evnt_preventDefault ()

void        gdome_evnt_preventDefault       (GdomeEvent *self,
                                             GdomeException *exc);

If an event is cancelable, the preventDefault method is used to signify that the event is to be canceled, meaning any default action normally taken by the implementation as a result of the event will not occur. If, during any stage of event flow, the preventDefault method is called the event is canceled. Any default action associated with the event will not occur. Calling this method for a non-cancelable event has no effect. Once preventDefault has been called it will remain in effect throughout the remainder of the event's propagation. This method may be used during any stage of event flow.


gdome_evnt_stopPropagation ()

void        gdome_evnt_stopPropagation      (GdomeEvent *self,
                                             GdomeException *exc);

The stopPropagation method is used prevent further propagation of an event during event flow. If this method is called by any EventListener the event will cease propagating through the tree. The event will complete dispatch to all listeners on the current EventTarget before event flow stops. This method may be used during any stage of event flow.

gdome2-0.8.1/gtk-doc/html/gdome2-gdomeeventlistener.html0000664000076400007640000004223607727712765016663 GdomeEventListener

GdomeEventListener

Name

GdomeEventListener -- Interface EventListener implementation.

Description

The GdomeEventListener interface is the primary method for handling events. Users implement the GdomeEventListener interface and register their listener on an GdomeEventTarget using the gdome_n_AddEventListener() method. The users should also remove their GdomeEventListener from its GdomeEventTarget after they have completed using the listener.

When a GdomeNode is copied using the gdome_n_cloneNode() method the GdomeEventListeners attached to the source GdomeNode are not attached to the copied GdomeNode. If the user wishes the same GdomeEventListeners to be added to the newly created copy the user must add them manually.

Details

struct GdomeEventListener

struct GdomeEventListener {
	gpointer user_data;
};




gdome_evntl_ref ()

void        gdome_evntl_ref                 (GdomeEventListener *self,
                                             GdomeException *exc);

Increase the reference count of the specified EventListener.


gdome_evntl_unref ()

void        gdome_evntl_unref               (GdomeEventListener *self,
                                             GdomeException *exc);

Decrease the reference count of the specified EventListener. Free the EventListener structure if the EventListener will have zero reference.



gdome_evntl_handleEvent ()

void        gdome_evntl_handleEvent         (GdomeEventListener *self,
                                             GdomeEvent *evt,
                                             GdomeException *exc);

This method is called whenever an event occurs of the type for which the EventListener interface was registered.


gdome_evntl_get_priv ()

gpointer    gdome_evntl_get_priv            (GdomeEventListener *self);

DEPRECATED

gdome2-0.8.1/gtk-doc/html/gdome2-xpath.html0000664000076400007640000000642507606515350014067 XPath modules

XPath modules

Table of Contents
XPath Basic Types and Enumerations -- Description of basic types, classes and enumeration for "XPath" modules.
GdomeXPathEvaluator -- Interface XPathEvaluator implementation.
GdomeXPathNamespace -- Interface XPathNamespace implementation.
GdomeXPathNSResolver -- Interface XPathNSResolver implementation
GdomeXPathResult -- Interface XPathResult implementation.
gdome2-0.8.1/gtk-doc/html/gdome2-xpath-basic-types-and-enumerations.html0000664000076400007640000001065107727712765021570 XPath Basic Types and Enumerations

XPath Basic Types and Enumerations

Name

XPath Basic Types and Enumerations -- Description of basic types, classes and enumeration for "XPath" modules.

Description

Details

enum GdomeXPathResultType

typedef enum {
	GDOME_ANY_TYPE = 0,
	GDOME_NUMBER_TYPE = 1,
	GDOME_STRING_TYPE = 2,
	GDOME_BOOLEAN_TYPE = 3,
  GDOME_UNORDERED_NODE_ITERATOR_TYPE = 4,
  GDOME_ORDERED_NODE_ITERATOR_TYPE = 5,
  GDOME_UNORDERED_NODE_SNAPSHOT_TYPE = 6,
  GDOME_ORDERED_NODE_SNAPSHOT_TYPE = 7,
  GDOME_ANY_UNORDERED_NODE_TYPE = 8,
  GDOME_FIRST_ORDERED_NODE_TYPE = 9
} GdomeXPathResultType;


enum GdomeXPathExceptionCode

typedef enum {
  GDOME_INVALID_EXPRESSION_ERR = 101,
  GDOME_TYPE_ERR = 102
} GdomeXPathExceptionCode;

gdome2-0.8.1/gtk-doc/html/gdome2-gdomemutationevent.html0000664000076400007640000013520207727712765016672 GdomeMutationEvent

GdomeMutationEvent

Name

GdomeMutationEvent -- Interface MutationEvent implementation.

Synopsis



struct      GdomeMutationEvent;
GdomeMutationEvent* gdome_mevnt_mkref       (void);
void        gdome_mevnt_ref                 (GdomeMutationEvent *self,
                                             GdomeException *exc);
void        gdome_mevnt_unref               (GdomeMutationEvent *self,
                                             GdomeException *exc);
gpointer    gdome_mevnt_query_interface     (GdomeMutationEvent *self,
                                             const char *interface,
                                             GdomeException *exc);
GdomeBoolean gdome_mevnt_bubbles            (GdomeMutationEvent *self,
                                             GdomeException *exc);
GdomeBoolean gdome_mevnt_cancelable         (GdomeMutationEvent *self,
                                             GdomeException *exc);
GdomeNode*  gdome_mevnt_currentTarget       (GdomeMutationEvent *self,
                                             GdomeException *exc);
unsigned short gdome_mevnt_eventPhase       (GdomeMutationEvent *self,
                                             GdomeException *exc);
GdomeNode*  gdome_mevnt_target              (GdomeMutationEvent *self,
                                             GdomeException *exc);
GdomeDOMTimeStamp gdome_mevnt_timeStamp     (GdomeMutationEvent *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_mevnt_type            (GdomeMutationEvent *self,
                                             GdomeException *exc);
gushort     gdome_mevnt_attrChange          (GdomeMutationEvent *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_mevnt_attrName        (GdomeMutationEvent *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_mevnt_newValue        (GdomeMutationEvent *self,
                                             GdomeException *exc);
GdomeDOMString* gdome_mevnt_prevValue       (GdomeMutationEvent *self,
                                             GdomeException *exc);
GdomeNode*  gdome_mevnt_relatedNode         (GdomeMutationEvent *self,
                                             GdomeException *exc);
void        gdome_mevnt_initEvent           (GdomeMutationEvent *self,
                                             GdomeDOMString *eventTypeArg,
                                             GdomeBoolean canBubbleArg,
                                             GdomeBoolean cancelableArg,
                                             GdomeException *exc);
void        gdome_mevnt_preventDefault      (GdomeMutationEvent *self,
                                             GdomeException *exc);
void        gdome_mevnt_stopPropagation     (GdomeMutationEvent *self,
                                             GdomeException *exc);
void        gdome_mevnt_initMutationEvent   (GdomeMutationEvent *self,
                                             GdomeDOMString *typeArg,
                                             GdomeBoolean canBubbleArg,
                                             GdomeBoolean cancelableArg,
                                             GdomeNode *relatedNodeArg,
                                             GdomeDOMString *prevValueArg,
                                             GdomeDOMString *newValueArg,
                                             GdomeDOMString *attrNameArg,
                                             gushort attrChangeArg,
                                             GdomeException *exc);

Description

GdomeMutationEvent objects are designed to signal notification of any changes to the structure of a document, including attr and text modifications. It may be noted that none of the mutation events are designated as cancelable. This stems from the fact that it is very difficult to make use of existing DOM interfaces which cause document modifications if any change to the document might or might not take place due to cancelation of the related event.

Note: To create an instance of the GdomeMutationEvent interface, use the feature string "MutationEvents" as the value of the input parameter used with the gdome_doc_createEvent() method of the GdomeDocument interface.

Details

struct GdomeMutationEvent

struct GdomeMutationEvent {
	gpointer user_data;
};



gdome_mevnt_ref ()

void        gdome_mevnt_ref                 (GdomeMutationEvent *self,
                                             GdomeException *exc);

Increase the reference count of the specified Event.


gdome_mevnt_unref ()

void        gdome_mevnt_unref               (GdomeMutationEvent *self,
                                             GdomeException *exc);

Decrease the reference count of the specified Event. Free the Event structure if the Event will have zero reference.















gdome_mevnt_initEvent ()

void        gdome_mevnt_initEvent           (GdomeMutationEvent *self,
                                             GdomeDOMString *eventTypeArg,
                                             GdomeBoolean canBubbleArg,
                                             GdomeBoolean cancelableArg,
                                             GdomeException *exc);

The initEvent method is used to initialize the value of an Event created through the gdome_doc_createEvent() API. This method may only be called before the Event has been dispatched via the dispatchEvent method, though it may be called multiple times during that phase if necessary. If called multiple times the final invocation takes precedence. If called from a subclass of Event interface only the values specified in the initEvent method are modified, all other attributes are left unchanged.


gdome_mevnt_preventDefault ()

void        gdome_mevnt_preventDefault      (GdomeMutationEvent *self,
                                             GdomeException *exc);

If an event is cancelable, the preventDefault method is used to signify that the event is to be canceled, meaning any default action normally taken by the implementation as a result of the event will not occur. If, during any stage of event flow, the preventDefault method is called the event is canceled. Any default action associated with the event will not occur. Calling this method for a non-cancelable event has no effect. Once preventDefault has been called it will remain in effect throughout the remainder of the event's propagation. This method may be used during any stage of event flow.


gdome_mevnt_stopPropagation ()

void        gdome_mevnt_stopPropagation     (GdomeMutationEvent *self,
                                             GdomeException *exc);

The stopPropagation method is used prevent further propagation of an event during event flow. If this method is called by any EventListener the event will cease propagating through the tree. The event will complete dispatch to all listeners on the current EventTarget before event flow stops. This method may be used during any stage of event flow.


gdome_mevnt_initMutationEvent ()

void        gdome_mevnt_initMutationEvent   (GdomeMutationEvent *self,
                                             GdomeDOMString *typeArg,
                                             GdomeBoolean canBubbleArg,
                                             GdomeBoolean cancelableArg,
                                             GdomeNode *relatedNodeArg,
                                             GdomeDOMString *prevValueArg,
                                             GdomeDOMString *newValueArg,
                                             GdomeDOMString *attrNameArg,
                                             gushort attrChangeArg,
                                             GdomeException *exc);

The initMutationEvent method is used to initialize the value of a GdomeMutationEvent created through the DocumentEvent interface. This method may only be called before the MutationEvent has been dispatched via the dispatchEvent method, though it may be called multiple times during that phase if necessary. If called multiple times, the final invocation takes precedence.

gdome2-0.8.1/gtk-doc/html/gdome2-gdomexpathevaluator.html0000664000076400007640000004231407727712765017040 GdomeXPathEvaluator

GdomeXPathEvaluator

Name

GdomeXPathEvaluator -- Interface XPathEvaluator implementation.

Description

This implements the DOM Level 3 XPath W3C Working Draft 08 February 2002. API SUBJECT TO CHANGE!

The evaluation of XPath expressions is provided by GdomeXPathEvaluator, which will provide evaluation of XPath 1.0 expressions with no specialized extension functions or variables. It is expected that the GdomeXPathEvaluator interface will be implemented on the same object which implements the GdomeDocument interface in an implementation which supports the XPath DOM module. GdomeXPathEvaluator implementations may be available from other sources that may provide support for new versions of XPath or special extension functions or variables which are not defined in this specification.

Details

struct GdomeXPathEvaluator

struct GdomeXPathEvaluator {
	gpointer user_data;
};


gdome_xpeval_mkref ()

GdomeXPathEvaluator* gdome_xpeval_mkref     (void);

Constructor of the XPathEvaluator interface.


gdome_xpeval_ref ()

void        gdome_xpeval_ref                (GdomeXPathEvaluator *self,
                                             GdomeException *exc);

Increase the reference count of the XPathEvaluator structure.


gdome_xpeval_unref ()

void        gdome_xpeval_unref              (GdomeXPathEvaluator *self,
                                             GdomeException *exc);

Decrease the reference count of the XPathEvaluator. Free the structure if XPathEvaluator will have zero reference.


gdome_xpeval_createNSResolver ()

GdomeXPathNSResolver* gdome_xpeval_createNSResolver
                                            (GdomeXPathEvaluator *self,
                                             GdomeNode *nodeResolver,
                                             GdomeException *exc);

Adapts any DOM node to resolve namespaces so that an XPath expression can be easily evaluated relative to the context of the node where it appeared within the document.



gdome2-0.8.1/gtk-doc/html/gdome2-gdomexpathnamespace.html0000664000076400007640000004064307727712765016775 GdomeXPathNamespace

GdomeXPathNamespace

Name

GdomeXPathNamespace -- Interface XPathNamespace implementation.

Description

This implements the DOM Level 3 XPath W3C Working Draft 08 February 2002. API SUBJECT TO CHANGE!

The GdomeXPathNamespace interface is returned by GdomeXPathResult interfaces to represent the XPath namespace node type that DOM lacks. There is no public constructor for this node type. Attempts to place it into a hierarchy or a GdomeNamedNodeMap result in a GdomeDOMException with the code GDOME_HIERARCHY_REQUEST_ERR. This node is read only, so methods or setting of attributes that would mutate the node result in a GdomeDOMException with the code GDOME_NO_MODIFICATION_ALLOWED_ERR. The core specification describes attributes of the Node interface that are different for different node node types but does not describe GDOME_XPATH_NAMESPACE_NODE, so here is a description of those attributes for this node type. All attributes of Node not described in this section have a NULL or FALSE value.

Details

struct GdomeXPathNamespace

struct GdomeXPathNamespace {
	gpointer user_data;
};






gdome_xpns_ownerElement ()

GdomeElement* gdome_xpns_ownerElement       (GdomeXPathNamespace *self,
                                             GdomeException *exc);

NOT IMPLEMENTED


gdome2-0.8.1/gtk-doc/html/gdome2-gdomexpathnsresolver.html0000664000076400007640000002614707727712765017246 GdomeXPathNSResolver

GdomeXPathNSResolver

Name

GdomeXPathNSResolver -- Interface XPathNSResolver implementation

Description

This implements the DOM Level 3 XPath W3C Working Draft 08 February 2002. API SUBJECT TO CHANGE!

The GdomeXPathNSResolver interface permit prefix strings in the expression to be properly bound to namespaceURI strings. GdomeXPathEvaluator can construct an implementation of GdomeXPathNSResolver from a node, or the interface may be implemented by any application.

Details

struct GdomeXPathNSResolver

struct GdomeXPathNSResolver {
	gpointer user_data;
};


gdome_xpnsresolv_mkref ()

GdomeXPathNSResolver* gdome_xpnsresolv_mkref
                                            (GdomeNode *nodeResolver);


gdome_xpnsresolv_ref ()

void        gdome_xpnsresolv_ref            (GdomeXPathNSResolver *self,
                                             GdomeException *exc);

Increase the reference count of the XPathNSResolver structure.


gdome_xpnsresolv_unref ()

void        gdome_xpnsresolv_unref          (GdomeXPathNSResolver *self,
                                             GdomeException *exc);

Decrease the reference count of the XPathNSResolver. Free the structure if XPathNSResolver will have zero reference.


gdome_xpnsresolv_lookupNamespaceURI ()

GdomeDOMString* gdome_xpnsresolv_lookupNamespaceURI
                                            (GdomeXPathNSResolver *self,
                                             GdomeDOMString *prefix,
                                             GdomeException *exc);

Look up the namespace URI associated to the given namespace prefix. The XPath evaluator must never call this with a null or empty argument, because the result of doing this is undefined.

gdome2-0.8.1/gtk-doc/html/gdome2-gdomexpathresult.html0000664000076400007640000004336207727712765016360 GdomeXPathResult

GdomeXPathResult

Name

GdomeXPathResult -- Interface XPathResult implementation.

Description

This implements the DOM Level 3 XPath W3C Working Draft 08 February 2002. API SUBJECT TO CHANGE!

The GdomeXPathResult interface represents the result of the evaluation of an XPath expression within the context of a particular node. Since evaluation of an XPath expression can result in various result types, this object makes it possible to discover and manipulate the type and value of the result.

Details

struct GdomeXPathResult

struct GdomeXPathResult {
	gpointer user_data;
};


gdome_xpresult_ref ()

void        gdome_xpresult_ref              (GdomeXPathResult *self,
                                             GdomeException *exc);

Increase the reference count of the XPathResult structure.


gdome_xpresult_unref ()

void        gdome_xpresult_unref            (GdomeXPathResult *self,
                                             GdomeException *exc);

Decrease the reference count of the XPathResult. Free the structure if XPathResult will have zero reference.







gdome_xpresult_iterateNext ()

GdomeNode*  gdome_xpresult_iterateNext      (GdomeXPathResult *self,
                                             GdomeException *exc);

Iterates and returns the next node from the node set or NULL if there are no more nodes.

gdome2-0.8.1/gtk-doc/html/gdome2-memory.html0000664000076400007640000000537607606515350014257 Memory Management Systemgdome2-0.8.1/gtk-doc/html/gdome2-module-private-list.html0000664000076400007640000003010207727712765016653 Module Private List

Module Private List

Name

Module Private List -- Structures and APIs

Description

This module is used to debug the gdome2 reference counting system, you can access to those information specifing --with-ref-debug option configuring gdome2 compilation process (./configure --with-ref-debug).

Details

struct GdomePrivateList

struct GdomePrivateList {
	void *data;
	GdomePrivateList *next;
};


gdome_private_list_append ()

GdomePrivateList* gdome_private_list_append (GdomePrivateList *list,
                                             void *data);

Append a new element containing data to the list specified.


gdome_private_list_prepend ()

GdomePrivateList* gdome_private_list_prepend
                                            (GdomePrivateList *list,
                                             void *data);

Add a new element containing data at the first position of list specified.


gdome_private_list_length ()

unsigned int gdome_private_list_length      (GdomePrivateList *list);


gdome_private_list_remove ()

GdomePrivateList* gdome_private_list_remove (GdomePrivateList *list,
                                             void *data);

Remove the element containing data from the list.


gdome2-0.8.1/gtk-doc/html/gdome2-module-tree-garbage-collector.html0000664000076400007640000001654507727712765020560 Module Tree Garbage Collector

Module Tree Garbage Collector

Name

Module Tree Garbage Collector -- Structures and APIs

Description

This is module is internally used to manage the number of gdome2 live references. Externally you can use this module to test the number of live references in your Document with gdome_treegc_livenodes() function.

Details


gdome_treegc_addNode ()

void        gdome_treegc_addNode            (GdomeNode *node);

Increase the livenodes field


gdome_treegc_delNode ()

void        gdome_treegc_delNode            (GdomeNode *node);

Decrease the livenodes field. If the field reaches zero (that is, there are no more live wrappers) free the whole document tree


gdome_treegc_invalidateNode ()

void        gdome_treegc_invalidateNode     (GdomeNode *node);

Set the n field of the wrapper to NULL and decrease the livenode field of the document

gdome2-0.8.1/gtk-doc/html/index.sgml0000664000076400007640000022435307727712765012714 gdome2-0.8.1/gtk-doc/Makefile.am0000664000076400007640000000525507452774574012010 ## Process this file with automake to produce Makefile.in # The name of the module. DOC_MODULE=gdome2-$(VERSION) # The top-level SGML file. DOC_MAIN_SGML_FILE=gdome2-docs.sgml # The directory containing the source code (if it contains documentation). DOC_SOURCE_DIR=../libgdome HTML_DIR=@HTML_DIR@ TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE) scan: gtkdoc-scan --module=gdome2 $(DOC_SOURCE_DIR)/gdome.h $(DOC_SOURCE_DIR)/gdome-private-list.h $(DOC_SOURCE_DIR)/gdome-events.h $(DOC_SOURCE_DIR)/gdome-xpath.h $(DOC_SOURCE_DIR)/gdome-treegc.h templates: scan gtkdoc-mktmpl --module=gdome2 sgml: gtkdoc-mkdb --module=gdome2 --source-dir=$(DOC_SOURCE_DIR) html: if ! test -d html ; then mkdir html ; fi -cd html && gtkdoc-mkhtml gdome2 ../$(DOC_MAIN_SGML_FILE) clean-local: rm -f *~ *.bak *.hierarchy *.signals *.args *-unused.txt maintainer-clean-local: clean rm -rf sgml html gdome2-decl-list.txt gdome2-decl.txt install-data-local: -install -d -m 0755 $(TARGET_DIR) -install -m 0644 $(srcdir)/html/*.html $(TARGET_DIR) -install -m 0644 $(srcdir)/html/index.sgml $(TARGET_DIR) -(cd $(DESTDIR); gtkdoc-fixxref --module=$(DOC_MODULE) --html-dir=$(HTML_DIR)) .PHONY : html sgml templates scan NULL = EXTRA_DIST = \ gdome2-docs.sgml \ gdome2-sections.txt \ html/book1.html \ html/gdome2-basic-types-and-enumerations.html \ html/gdome2-core.html \ html/gdome2-gdomeattr.html \ html/gdome2-gdomecdatasection.html \ html/gdome2-gdomecharacterdata.html \ html/gdome2-gdomecomment.html \ html/gdome2-gdomedocument.html \ html/gdome2-gdomedocumentfragment.html \ html/gdome2-gdomedocumenttype.html \ html/gdome2-gdomedomimplementation.html \ html/gdome2-gdomeelement.html \ html/gdome2-gdomeentity.html \ html/gdome2-gdomeentityreference.html \ html/gdome2-gdomenamednodemap.html \ html/gdome2-gdomenode.html \ html/gdome2-gdomenodelist.html \ html/gdome2-gdomenotation.html \ html/gdome2-gdomeprocessinginstruction.html \ html/gdome2-gdometext.html \ html/gdome2-events-basic-types-and-enumerations.html \ html/gdome2-events.html \ html/gdome2-gdomeevent.html \ html/gdome2-gdomeeventlistener.html \ html/gdome2-xpath.html \ html/gdome2-xpath-basic-types-and-enumerations.html \ html/gdome2-gdomemutationevent.html \ html/gdome2-gdomexpathevaluator.html \ html/gdome2-gdomexpathnamespace.html \ html/gdome2-gdomexpathnsresolver.html \ html/gdome2-gdomexpathresult.html \ html/gdome2-memory.html \ html/gdome2-module-private-list.html \ html/gdome2-module-tree-garbage-collector.html \ html/index.sgml \ $(NULL) gdome2-0.8.1/gtk-doc/gdome2-docs.sgml0000664000076400007640000000622107437575325012731 ]> Gdome2 Reference Manual Core & XML modules &gdome2-Basic-Types-and-Enumerations; &gdome2-GdomeDOMImplementation; &gdome2-GdomeDocumentFragment; &gdome2-GdomeDocument; &gdome2-GdomeNode; &gdome2-GdomeNodeList; &gdome2-GdomeNamedNodeMap; &gdome2-GdomeCharacterData; &gdome2-GdomeAttr; &gdome2-GdomeElement; &gdome2-GdomeText; &gdome2-GdomeComment; &gdome2-GdomeCDATASection; &gdome2-GdomeDocumentType; &gdome2-GdomeNotation; &gdome2-GdomeEntity; &gdome2-GdomeEntityReference; &gdome2-GdomeProcessingInstruction; Events modules &gdome2-Events-Basic-Types-and-Enumerations; &gdome2-GdomeEventListener; &gdome2-GdomeEvent; &gdome2-GdomeMutationEvent; XPath modules &gdome2-XPath-Basic-Types-and-Enumerations; &gdome2-GdomeXPathEvaluator; &gdome2-GdomeXPathNamespace; &gdome2-GdomeXPathNSResolver; &gdome2-GdomeXPathResult; Memory Management System &gdome2-Module-Private-List; &gdome2-Module-Tree-Garbage-Collector; gdome2-0.8.1/gtk-doc/gdome2-sections.txt0000664000076400007640000004230507727712764013512
types Basic Types and Enumerations GdomeNodeType GdomeExceptionCode GdomeAccessType GdomeLoadingCode GdomeSavingCode GdomeBoolean GdomeDOMTimeStamp GdomeException GdomeEntitiesTableEntry GDOME_A GDOME_C GDOME_CD GDOME_CDS GDOME_DF GDOME_DOC GDOME_DT GDOME_EL GDOME_ENT GDOME_ER GDOME_N GDOME_NOT GDOME_PI GDOME_T GDOME_EVNTT GDOME_XMLNS_NAMESPACE GDOME_EXCEPTION_TYPE GDOME_EXCEPTION_CODE GdomeExceptionMasks GdomeExceptionType GdomeDOMString gdome_str_mkref gdome_str_mkref_own gdome_str_mkref_dup gdome_str_ref gdome_str_unref gdome_str_equal gdome_str_equalIgnoreCase gdome_str_charAt gdome_str_concat gdome_str_endsWith gdome_str_isEmpty gdome_str_length gdome_str_startsWith
domimpl GdomeDOMImplementation GdomeDOMImplementation gdome_di_mkref gdome_di_ref gdome_di_unref gdome_di_query_interface gdome_di_hasFeature gdome_di_createDocumentType gdome_di_createDocument gdome_di_freeDoc gdome_di_createDocFromURI gdome_di_createDocFromMemory gdome_di_createDocFromURIWithEntitiesTable gdome_di_createDocFromMemoryWithEntitiesTable gdome_di_saveDocToFile gdome_di_saveDocToFileEnc gdome_di_saveDocToMemory gdome_di_saveDocToMemoryEnc gdome_di_enableEvent gdome_di_disableEvent gdome_di_eventIsEnabled
documentf GdomeDocumentFragment GdomeDocumentFragment gdome_df_ref gdome_df_unref gdome_df_query_interface gdome_df_nodeName gdome_df_nodeValue gdome_df_set_nodeValue gdome_df_nodeType gdome_df_parentNode gdome_df_childNodes gdome_df_firstChild gdome_df_lastChild gdome_df_previousSibling gdome_df_nextSibling gdome_df_attributes gdome_df_ownerDocument gdome_df_insertBefore gdome_df_replaceChild gdome_df_removeChild gdome_df_appendChild gdome_df_hasChildNodes gdome_df_cloneNode gdome_df_normalize gdome_df_isSupported gdome_df_namespaceURI gdome_df_prefix gdome_df_set_prefix gdome_df_localName gdome_df_hasAttributes gdome_df_addEventListener gdome_df_removeEventListener gdome_df_dispatchEvent gdome_df_subTreeDispatchEvent gdome_df_canAppend
document GdomeDocument GdomeDocument gdome_doc_doctype gdome_doc_implementation gdome_doc_documentElement gdome_doc_createElement gdome_doc_createDocumentFragment gdome_doc_createTextNode gdome_doc_createComment gdome_doc_createCDATASection gdome_doc_createProcessingInstruction gdome_doc_createAttribute gdome_doc_createEntityReference gdome_doc_getElementsByTagName gdome_doc_importNode gdome_doc_createElementNS gdome_doc_createAttributeNS gdome_doc_getElementsByTagNameNS gdome_doc_getElementById gdome_doc_createEvent gdome_doc_ref gdome_doc_unref gdome_doc_query_interface gdome_doc_nodeName gdome_doc_nodeValue gdome_doc_set_nodeValue gdome_doc_nodeType gdome_doc_parentNode gdome_doc_childNodes gdome_doc_firstChild gdome_doc_lastChild gdome_doc_previousSibling gdome_doc_nextSibling gdome_doc_attributes gdome_doc_ownerDocument gdome_doc_insertBefore gdome_doc_replaceChild gdome_doc_removeChild gdome_doc_appendChild gdome_doc_hasChildNodes gdome_doc_cloneNode gdome_doc_normalize gdome_doc_isSupported gdome_doc_namespaceURI gdome_doc_prefix gdome_doc_set_prefix gdome_doc_localName gdome_doc_hasAttributes gdome_doc_addEventListener gdome_doc_removeEventListener gdome_doc_dispatchEvent gdome_doc_subTreeDispatchEvent gdome_doc_canAppend
node GdomeNode GdomeNode gdome_n_ref gdome_n_unref gdome_n_query_interface gdome_n_nodeName gdome_n_nodeValue gdome_n_set_nodeValue gdome_n_nodeType gdome_n_parentNode gdome_n_childNodes gdome_n_firstChild gdome_n_lastChild gdome_n_previousSibling gdome_n_nextSibling gdome_n_attributes gdome_n_ownerDocument gdome_n_insertBefore gdome_n_replaceChild gdome_n_removeChild gdome_n_appendChild gdome_n_hasChildNodes gdome_n_cloneNode gdome_n_normalize gdome_n_isSupported gdome_n_namespaceURI gdome_n_prefix gdome_n_set_prefix gdome_n_localName gdome_n_hasAttributes gdome_n_addEventListener gdome_n_removeEventListener gdome_n_dispatchEvent gdome_n_subTreeDispatchEvent gdome_n_canAppend
nodel GdomeNodeList GdomeNodeList gdome_nl_ref gdome_nl_unref gdome_nl_query_interface gdome_nl_item gdome_nl_length
nnodem GdomeNamedNodeMap GdomeNamedNodeMap gdome_nnm_ref gdome_nnm_unref gdome_nnm_query_interface gdome_nnm_getNamedItem gdome_nnm_setNamedItem gdome_nnm_removeNamedItem gdome_nnm_item gdome_nnm_length gdome_nnm_getNamedItemNS gdome_nnm_setNamedItemNS gdome_nnm_removeNamedItemNS
cdata GdomeCharacterData GdomeCharacterData gdome_cd_data gdome_cd_set_data gdome_cd_length gdome_cd_substringData gdome_cd_appendData gdome_cd_insertData gdome_cd_deleteData gdome_cd_replaceData gdome_cd_ref gdome_cd_unref gdome_cd_query_interface gdome_cd_nodeName gdome_cd_nodeValue gdome_cd_set_nodeValue gdome_cd_nodeType gdome_cd_parentNode gdome_cd_childNodes gdome_cd_firstChild gdome_cd_lastChild gdome_cd_previousSibling gdome_cd_nextSibling gdome_cd_attributes gdome_cd_ownerDocument gdome_cd_insertBefore gdome_cd_replaceChild gdome_cd_removeChild gdome_cd_appendChild gdome_cd_hasChildNodes gdome_cd_cloneNode gdome_cd_normalize gdome_cd_isSupported gdome_cd_namespaceURI gdome_cd_prefix gdome_cd_set_prefix gdome_cd_localName gdome_cd_hasAttributes gdome_cd_addEventListener gdome_cd_removeEventListener gdome_cd_dispatchEvent gdome_cd_subTreeDispatchEvent gdome_cd_canAppend
attribute GdomeAttr GdomeAttr gdome_a_ref gdome_a_unref gdome_a_query_interface gdome_a_name gdome_a_ownerElement gdome_a_specified gdome_a_value gdome_a_set_value gdome_a_nodeName gdome_a_nodeValue gdome_a_set_nodeValue gdome_a_nodeType gdome_a_parentNode gdome_a_childNodes gdome_a_firstChild gdome_a_lastChild gdome_a_previousSibling gdome_a_nextSibling gdome_a_attributes gdome_a_ownerDocument gdome_a_insertBefore gdome_a_replaceChild gdome_a_removeChild gdome_a_appendChild gdome_a_hasChildNodes gdome_a_cloneNode gdome_a_normalize gdome_a_isSupported gdome_a_namespaceURI gdome_a_prefix gdome_a_set_prefix gdome_a_localName gdome_a_hasAttributes gdome_a_addEventListener gdome_a_removeEventListener gdome_a_dispatchEvent gdome_a_subTreeDispatchEvent gdome_a_canAppend
element GdomeElement GdomeElement gdome_el_tagName gdome_el_getAttribute gdome_el_setAttribute gdome_el_removeAttribute gdome_el_getAttributeNode gdome_el_setAttributeNode gdome_el_removeAttributeNode gdome_el_getElementsByTagName gdome_el_getAttributeNS gdome_el_setAttributeNS gdome_el_removeAttributeNS gdome_el_getAttributeNodeNS gdome_el_setAttributeNodeNS gdome_el_getElementsByTagNameNS gdome_el_hasAttribute gdome_el_hasAttributeNS gdome_el_ref gdome_el_unref gdome_el_query_interface gdome_el_nodeName gdome_el_nodeValue gdome_el_set_nodeValue gdome_el_nodeType gdome_el_parentNode gdome_el_childNodes gdome_el_firstChild gdome_el_lastChild gdome_el_previousSibling gdome_el_nextSibling gdome_el_attributes gdome_el_ownerDocument gdome_el_insertBefore gdome_el_replaceChild gdome_el_removeChild gdome_el_appendChild gdome_el_hasChildNodes gdome_el_cloneNode gdome_el_normalize gdome_el_isSupported gdome_el_namespaceURI gdome_el_prefix gdome_el_set_prefix gdome_el_localName gdome_el_hasAttributes gdome_el_addEventListener gdome_el_removeEventListener gdome_el_dispatchEvent gdome_el_subTreeDispatchEvent gdome_el_canAppend
text GdomeText GdomeText gdome_t_splitText gdome_t_data gdome_t_set_data gdome_t_length gdome_t_substringData gdome_t_appendData gdome_t_insertData gdome_t_deleteData gdome_t_replaceData gdome_t_ref gdome_t_unref gdome_t_query_interface gdome_t_nodeName gdome_t_nodeValue gdome_t_set_nodeValue gdome_t_nodeType gdome_t_parentNode gdome_t_childNodes gdome_t_firstChild gdome_t_lastChild gdome_t_previousSibling gdome_t_nextSibling gdome_t_attributes gdome_t_ownerDocument gdome_t_insertBefore gdome_t_replaceChild gdome_t_removeChild gdome_t_appendChild gdome_t_hasChildNodes gdome_t_cloneNode gdome_t_normalize gdome_t_isSupported gdome_t_namespaceURI gdome_t_prefix gdome_t_set_prefix gdome_t_localName gdome_t_hasAttributes gdome_t_addEventListener gdome_t_removeEventListener gdome_t_dispatchEvent gdome_t_subTreeDispatchEvent gdome_t_canAppend
comment GdomeComment GdomeComment gdome_c_data gdome_c_set_data gdome_c_length gdome_c_substringData gdome_c_appendData gdome_c_insertData gdome_c_deleteData gdome_c_replaceData gdome_c_ref gdome_c_unref gdome_c_query_interface gdome_c_nodeName gdome_c_nodeValue gdome_c_set_nodeValue gdome_c_nodeType gdome_c_parentNode gdome_c_childNodes gdome_c_firstChild gdome_c_lastChild gdome_c_previousSibling gdome_c_nextSibling gdome_c_attributes gdome_c_ownerDocument gdome_c_insertBefore gdome_c_replaceChild gdome_c_removeChild gdome_c_appendChild gdome_c_hasChildNodes gdome_c_cloneNode gdome_c_normalize gdome_c_isSupported gdome_c_namespaceURI gdome_c_prefix gdome_c_set_prefix gdome_c_localName gdome_c_hasAttributes gdome_c_addEventListener gdome_c_removeEventListener gdome_c_dispatchEvent gdome_c_subTreeDispatchEvent gdome_c_canAppend
cdatas GdomeCDATASection GdomeCDATASection gdome_cds_splitText gdome_cds_data gdome_cds_set_data gdome_cds_length gdome_cds_substringData gdome_cds_appendData gdome_cds_insertData gdome_cds_deleteData gdome_cds_replaceData gdome_cds_ref gdome_cds_unref gdome_cds_query_interface gdome_cds_nodeName gdome_cds_nodeValue gdome_cds_set_nodeValue gdome_cds_nodeType gdome_cds_parentNode gdome_cds_childNodes gdome_cds_firstChild gdome_cds_lastChild gdome_cds_previousSibling gdome_cds_nextSibling gdome_cds_attributes gdome_cds_ownerDocument gdome_cds_insertBefore gdome_cds_replaceChild gdome_cds_removeChild gdome_cds_appendChild gdome_cds_hasChildNodes gdome_cds_cloneNode gdome_cds_normalize gdome_cds_isSupported gdome_cds_namespaceURI gdome_cds_prefix gdome_cds_set_prefix gdome_cds_localName gdome_cds_hasAttributes gdome_cds_addEventListener gdome_cds_removeEventListener gdome_cds_dispatchEvent gdome_cds_subTreeDispatchEvent gdome_cds_canAppend
documentt GdomeDocumentType GdomeDocumentType gdome_dt_name gdome_dt_entities gdome_dt_notations gdome_dt_publicId gdome_dt_systemId gdome_dt_internalSubset gdome_dt_ref gdome_dt_unref gdome_dt_query_interface gdome_dt_nodeName gdome_dt_nodeValue gdome_dt_set_nodeValue gdome_dt_nodeType gdome_dt_parentNode gdome_dt_childNodes gdome_dt_firstChild gdome_dt_lastChild gdome_dt_previousSibling gdome_dt_nextSibling gdome_dt_attributes gdome_dt_ownerDocument gdome_dt_insertBefore gdome_dt_replaceChild gdome_dt_removeChild gdome_dt_appendChild gdome_dt_hasChildNodes gdome_dt_cloneNode gdome_dt_normalize gdome_dt_isSupported gdome_dt_namespaceURI gdome_dt_prefix gdome_dt_set_prefix gdome_dt_localName gdome_dt_hasAttributes gdome_dt_addEventListener gdome_dt_removeEventListener gdome_dt_dispatchEvent gdome_dt_subTreeDispatchEvent gdome_dt_canAppend
notation GdomeNotation GdomeNotation gdome_not_publicId gdome_not_systemId gdome_not_ref gdome_not_unref gdome_not_query_interface gdome_not_nodeName gdome_not_nodeValue gdome_not_set_nodeValue gdome_not_nodeType gdome_not_parentNode gdome_not_childNodes gdome_not_firstChild gdome_not_lastChild gdome_not_previousSibling gdome_not_nextSibling gdome_not_attributes gdome_not_ownerDocument gdome_not_insertBefore gdome_not_replaceChild gdome_not_removeChild gdome_not_appendChild gdome_not_hasChildNodes gdome_not_cloneNode gdome_not_normalize gdome_not_isSupported gdome_not_namespaceURI gdome_not_prefix gdome_not_set_prefix gdome_not_localName gdome_not_hasAttributes gdome_not_addEventListener gdome_not_removeEventListener gdome_not_dispatchEvent gdome_not_subTreeDispatchEvent gdome_not_canAppend
entity GdomeEntity GdomeEntity gdome_ent_publicId gdome_ent_systemId gdome_ent_notationName gdome_ent_ref gdome_ent_unref gdome_ent_query_interface gdome_ent_nodeName gdome_ent_nodeValue gdome_ent_set_nodeValue gdome_ent_nodeType gdome_ent_parentNode gdome_ent_childNodes gdome_ent_firstChild gdome_ent_lastChild gdome_ent_previousSibling gdome_ent_nextSibling gdome_ent_attributes gdome_ent_ownerDocument gdome_ent_insertBefore gdome_ent_replaceChild gdome_ent_removeChild gdome_ent_appendChild gdome_ent_hasChildNodes gdome_ent_cloneNode gdome_ent_normalize gdome_ent_isSupported gdome_ent_namespaceURI gdome_ent_prefix gdome_ent_set_prefix gdome_ent_localName gdome_ent_hasAttributes gdome_ent_addEventListener gdome_ent_removeEventListener gdome_ent_dispatchEvent gdome_ent_subTreeDispatchEvent gdome_ent_canAppend
entityref GdomeEntityReference GdomeEntityReference gdome_er_ref gdome_er_unref gdome_er_query_interface gdome_er_nodeName gdome_er_nodeValue gdome_er_set_nodeValue gdome_er_nodeType gdome_er_parentNode gdome_er_childNodes gdome_er_firstChild gdome_er_lastChild gdome_er_previousSibling gdome_er_nextSibling gdome_er_attributes gdome_er_ownerDocument gdome_er_insertBefore gdome_er_replaceChild gdome_er_removeChild gdome_er_appendChild gdome_er_hasChildNodes gdome_er_cloneNode gdome_er_normalize gdome_er_isSupported gdome_er_namespaceURI gdome_er_prefix gdome_er_set_prefix gdome_er_localName gdome_er_hasAttributes gdome_er_addEventListener gdome_er_removeEventListener gdome_er_dispatchEvent gdome_er_subTreeDispatchEvent gdome_er_canAppend
pi GdomeProcessingInstruction GdomeProcessingInstruction gdome_pi_target gdome_pi_data gdome_pi_set_data gdome_pi_ref gdome_pi_unref gdome_pi_query_interface gdome_pi_nodeName gdome_pi_nodeValue gdome_pi_set_nodeValue gdome_pi_nodeType gdome_pi_parentNode gdome_pi_childNodes gdome_pi_firstChild gdome_pi_lastChild gdome_pi_previousSibling gdome_pi_nextSibling gdome_pi_attributes gdome_pi_ownerDocument gdome_pi_insertBefore gdome_pi_replaceChild gdome_pi_removeChild gdome_pi_appendChild gdome_pi_hasChildNodes gdome_pi_cloneNode gdome_pi_normalize gdome_pi_isSupported gdome_pi_namespaceURI gdome_pi_prefix gdome_pi_set_prefix gdome_pi_localName gdome_pi_hasAttributes gdome_pi_addEventListener gdome_pi_removeEventListener gdome_pi_dispatchEvent gdome_pi_subTreeDispatchEvent gdome_pi_canAppend
etypes Events Basic Types and Enumerations GdomePhaseType GdomeAttrChangeType GdomeEventExceptionCode GdomeEventType GdomeEventTarget GDOME_EVNT GDOME_MEVNT
eventl GdomeEventListener GdomeEventListener gdome_evntl_mkref gdome_evntl_aux_mkref gdome_evntl_ref gdome_evntl_unref gdome_evntl_query_interface gdome_evntl_handleEvent gdome_evntl_get_priv
event GdomeEvent GdomeEvent gdome_evnt_mkref gdome_evnt_ref gdome_evnt_unref gdome_evnt_query_interface gdome_evnt_bubbles gdome_evnt_cancelable gdome_evnt_currentTarget gdome_evnt_eventPhase gdome_evnt_target gdome_evnt_timeStamp gdome_evnt_type gdome_evnt_initEvent gdome_evnt_preventDefault gdome_evnt_stopPropagation
mevent GdomeMutationEvent GdomeMutationEvent gdome_mevnt_mkref gdome_mevnt_ref gdome_mevnt_unref gdome_mevnt_query_interface gdome_mevnt_bubbles gdome_mevnt_cancelable gdome_mevnt_currentTarget gdome_mevnt_eventPhase gdome_mevnt_target gdome_mevnt_timeStamp gdome_mevnt_type gdome_mevnt_attrChange gdome_mevnt_attrName gdome_mevnt_newValue gdome_mevnt_prevValue gdome_mevnt_relatedNode gdome_mevnt_initEvent gdome_mevnt_preventDefault gdome_mevnt_stopPropagation gdome_mevnt_initMutationEvent
xtypes XPath Basic Types and Enumerations GdomeXPathResultType GdomeXPathExceptionCode
xpeval GdomeXPathEvaluator GdomeXPathEvaluator gdome_xpeval_mkref gdome_xpeval_ref gdome_xpeval_unref gdome_xpeval_createNSResolver gdome_xpeval_createResult gdome_xpeval_evaluate
xpns GdomeXPathNamespace GdomeXPathNamespace gdome_xpns_namespaceURI gdome_xpns_nodeName gdome_xpns_nodeType gdome_xpns_ownerDocument gdome_xpns_ownerElement gdome_xpns_prefix
xpnsresolv GdomeXPathNSResolver GdomeXPathNSResolver gdome_xpnsresolv_mkref gdome_xpnsresolv_ref gdome_xpnsresolv_unref gdome_xpnsresolv_lookupNamespaceURI
xpresult GdomeXPathResult GdomeXPathResult gdome_xpresult_ref gdome_xpresult_unref gdome_xpresult_resultType gdome_xpresult_booleanValue gdome_xpresult_numberValue gdome_xpresult_singleNodeValue gdome_xpresult_stringValue gdome_xpresult_iterateNext
privatelist Module Private List GdomePrivateList gdome_private_list_append gdome_private_list_prepend gdome_private_list_length gdome_private_list_remove gdome_private_list_nth
treegc Module Tree Garbage Collector gdome_treegc_livenodes gdome_treegc_addNode gdome_treegc_delNode gdome_treegc_invalidateNode