From 7fc98d7dd6c25b6e2c278c8c0b8e324f53b7b42d Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 27 Oct 2016 13:57:29 +0900 Subject: [PATCH] Imported Upstream version 1.37.1 Change-Id: If29f0af3bca8075f775e2a1a0de9615aea15e76a Signed-off-by: DongHun Kwak --- Makefile-giscanner.am | 10 +- Makefile.am | 11 +- Makefile.in | 129 +- build-aux/config.sub | 2 +- build-aux/ltmain.sh | 18 +- build/win32/vs10/gir.props | 1 - build/win32/vs9/gir.vsprops | 1 - config.h.win32 | 6 +- configure | 41 +- configure.ac | 13 +- gir/gio-2.0.c | 3371 +++++++++++++++++++- gir/glib-2.0.c | 231 +- gir/gobject-2.0.c | 55 +- girepository/gdump.c | 3 + girepository/gibaseinfo.c | 25 +- girepository/girepository-private.h | 9 +- girepository/girepository.c | 105 +- girepository/girparser.c | 3 + girepository/gitypelib-internal.h | 8 +- girepository/gitypelib.c | 150 +- giscanner/annotationmain.py | 1 + giscanner/annotationparser.py | 99 +- giscanner/ast.py | 90 +- giscanner/cachestore.py | 21 +- giscanner/codegen.py | 12 +- giscanner/collections/__init__.py | 22 + giscanner/collections/ordereddict.py | 120 + giscanner/docmain.py | 1 + giscanner/docwriter.py | 29 +- giscanner/dumper.py | 31 +- giscanner/gdumpparser.py | 23 +- giscanner/girparser.py | 54 +- giscanner/girwriter.py | 23 +- giscanner/giscannermodule.c | 2 +- giscanner/introspectablepass.py | 46 +- giscanner/libtoolimporter.py | 2 +- giscanner/maintransformer.py | 198 +- giscanner/message.py | 18 +- giscanner/odict.py | 50 - giscanner/scannerlexer.l | 36 +- giscanner/scannermain.py | 44 +- giscanner/sectionparser.py | 31 +- giscanner/shlibs.py | 6 +- giscanner/sourcescanner.py | 41 +- giscanner/testcodegen.py | 3 + giscanner/transformer.py | 73 +- giscanner/utils.py | 9 + giscanner/xmlwriter.py | 20 +- gobject-introspection-1.0.pc | 6 +- gobject-introspection-no-export-1.0.pc | 6 +- m4/python.m4 | 2 +- misc/pep8.py | 1884 ++++++++--- scannerlexer.c | 1350 ++++---- scannerparser.c | 351 +- scannerparser.h | 12 +- tests/Makefile.am | 2 + tests/Makefile.in | 5 +- tests/gimarshallingtests.h | 3 +- tests/scanner/GetType-1.0-expected.gir | 14 +- tests/scanner/Makefile.am | 21 +- tests/scanner/Makefile.in | 22 +- .../Regress.AnnotationObject-tab-property.page | 2 +- .../Regress.AnnotationObject.page | 2 +- .../Regress.AnnotationObject.watch_full.page | 2 +- .../Regress.LikeXklConfigItem.page | 25 + .../Regress.LikeXklConfigItem.set_name.page | 57 + .../Regress.annotation_custom_destroy.page | 2 +- .../Regress.AnnotationObject-tab-property.page | 2 +- .../Regress.AnnotationObject.page | 2 +- .../Regress.AnnotationObject.watch_full.page | 2 +- .../Regress.LikeXklConfigItem.page | 25 + .../Regress.LikeXklConfigItem.set_name.page | 46 + .../Regress.annotation_custom_destroy.page | 2 +- .../Regress.AnnotationObject-tab-property.page | 2 +- .../Regress.AnnotationObject.page | 2 +- .../Regress.AnnotationObject.watch_full.page | 2 +- .../Regress.LikeXklConfigItem.page | 25 + .../Regress.LikeXklConfigItem.set_name.page | 55 + .../Regress.annotation_custom_destroy.page | 2 +- tests/scanner/Regress-1.0-expected.gir | 686 ++-- tests/scanner/annotation.c | 30 +- tests/scanner/annotation.h | 2 +- tests/scanner/annotationparser/test_parser.py | 3 +- tests/scanner/regress.c | 8 + tests/scanner/regress.h | 9 + tests/warn/Makefile.am | 4 +- tests/warn/Makefile.in | 4 +- tests/warn/warningtester.py | 16 +- tests/warn/warntestrunner | 2 +- 89 files changed, 7551 insertions(+), 2445 deletions(-) create mode 100644 giscanner/collections/__init__.py create mode 100644 giscanner/collections/ordereddict.py delete mode 100644 giscanner/odict.py create mode 100644 tests/scanner/Regress-1.0-C-expected/Regress.LikeXklConfigItem.page create mode 100644 tests/scanner/Regress-1.0-C-expected/Regress.LikeXklConfigItem.set_name.page create mode 100644 tests/scanner/Regress-1.0-Gjs-expected/Regress.LikeXklConfigItem.page create mode 100644 tests/scanner/Regress-1.0-Gjs-expected/Regress.LikeXklConfigItem.set_name.page create mode 100644 tests/scanner/Regress-1.0-Python-expected/Regress.LikeXklConfigItem.page create mode 100644 tests/scanner/Regress-1.0-Python-expected/Regress.LikeXklConfigItem.set_name.page diff --git a/Makefile-giscanner.am b/Makefile-giscanner.am index e8def0e..4775086 100644 --- a/Makefile-giscanner.am +++ b/Makefile-giscanner.am @@ -26,14 +26,14 @@ libgiscanner_la_CFLAGS = $(GOBJECT_CFLAGS) $(GIO_CFLAGS) # Python module pkgpyexecdir = $(pkglibdir)/giscanner pkgpyexec_LTLIBRARIES = _giscanner.la -pkgpyexec_PYTHON = \ +pkgpyexec_PYTHON = \ giscanner/__init__.py \ giscanner/annotationmain.py \ giscanner/annotationparser.py \ giscanner/ast.py \ giscanner/cachestore.py \ giscanner/codegen.py \ - giscanner/docmain.py \ + giscanner/docmain.py \ giscanner/docwriter.py \ giscanner/dumper.py \ giscanner/introspectablepass.py \ @@ -41,7 +41,6 @@ pkgpyexec_PYTHON = \ giscanner/girwriter.py \ giscanner/gdumpparser.py \ giscanner/libtoolimporter.py \ - giscanner/odict.py \ giscanner/maintransformer.py \ giscanner/message.py \ giscanner/shlibs.py \ @@ -53,6 +52,11 @@ pkgpyexec_PYTHON = \ giscanner/utils.py \ giscanner/xmlwriter.py +collectionsdir = $(pkgpyexecdir)/collections +collections_PYTHON = \ + giscanner/collections/__init__.py \ + giscanner/collections/ordereddict.py + templatedir = $(pkglibdir) nobase_dist_template_DATA = \ giscanner/doctemplates/base.tmpl \ diff --git a/Makefile.am b/Makefile.am index 736f3ad..c04c05a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,7 +29,7 @@ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} SUBDIRS = . docs tests build DIST_SUBDIRS = m4 $(SUBDIRS) -DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-doctool man_MANS += \ docs/g-ir-compiler.1 \ @@ -55,15 +55,20 @@ EXTRA_DIST += \ misc/pep8.py \ misc/pyflakes.py +# Default pep8.py --exclude + emacs backup files +PEP8_EXCLUDES=--exclude='.svn,CVS,.bzr,.hg,.git,__pycache__,.\#*' + check-local: gtester --verbose $(GTESTER_PROGS) @echo "TEST: PEP-8 INQUISITION" - @find $(top_srcdir)/giscanner -name \*.py | sort | uniq | xargs $(PYTHON) $(top_srcdir)/misc/pep8.py --repeat --exclude=config.py + @find $(top_srcdir)/giscanner -name \*.py | sort | uniq | xargs \ + $(PYTHON) $(top_srcdir)/misc/pep8.py --max-line-length=99 --ignore=E128 $(PEP8_EXCLUDES) + @find $(top_srcdir)/tests -name \*.py | sort | uniq | xargs \ + $(PYTHON) $(top_srcdir)/misc/pep8.py --ignore=E127,E501 $(PEP8_EXCLUDES) @echo "TEST: Annotation pattern programs" PYTHONPATH="$(top_builddir):$(top_srcdir)" $(PYTHON) $(top_srcdir)/tests/scanner/annotationparser/test_patterns.py @echo "TEST: GTK-Doc Annotation Parser" PYTHONPATH="$(top_builddir):$(top_srcdir)" $(PYTHON) $(top_srcdir)/tests/scanner/annotationparser/test_parser.py - @touch $(top_builddir)/.make-check-passed check-pyflakes: @echo " CHECK Pyflakes" diff --git a/Makefile.in b/Makefile.in index ffbe8cd..404620a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -119,13 +119,13 @@ DIST_COMMON = $(srcdir)/common.mk $(srcdir)/Makefile.introspection \ $(srcdir)/gobject-introspection-no-export-1.0.pc.in \ $(srcdir)/config.h.win32.in scannerlexer.c scannerparser.h \ scannerparser.c $(top_srcdir)/build-aux/depcomp \ - $(top_srcdir)/build-aux/ylwrap $(pkgpyexec_PYTHON) \ - $(top_srcdir)/build-aux/py-compile $(dist_make_DATA) \ - $(nobase_dist_template_DATA) $(girepo_HEADERS) AUTHORS COPYING \ - ChangeLog NEWS README TODO build-aux/compile \ - build-aux/config.guess build-aux/config.sub build-aux/depcomp \ - build-aux/install-sh build-aux/missing build-aux/py-compile \ - build-aux/ylwrap build-aux/ltmain.sh \ + $(top_srcdir)/build-aux/ylwrap $(collections_PYTHON) \ + $(pkgpyexec_PYTHON) $(top_srcdir)/build-aux/py-compile \ + $(dist_make_DATA) $(nobase_dist_template_DATA) \ + $(girepo_HEADERS) AUTHORS COPYING ChangeLog NEWS README TODO \ + build-aux/compile build-aux/config.guess build-aux/config.sub \ + build-aux/depcomp build-aux/install-sh build-aux/missing \ + build-aux/py-compile build-aux/ylwrap build-aux/ltmain.sh \ $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ @@ -192,11 +192,12 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgpyexecdir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(man1dir)" \ - "$(DESTDIR)$(makedir)" "$(DESTDIR)$(gdumpdir)" \ - "$(DESTDIR)$(girdir)" "$(DESTDIR)$(m4dir)" \ - "$(DESTDIR)$(templatedir)" "$(DESTDIR)$(pkgconfigdir)" \ - "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(girepodir)" + "$(DESTDIR)$(collectionsdir)" "$(DESTDIR)$(pkgpyexecdir)" \ + "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(makedir)" \ + "$(DESTDIR)$(gdumpdir)" "$(DESTDIR)$(girdir)" \ + "$(DESTDIR)$(m4dir)" "$(DESTDIR)$(templatedir)" \ + "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(typelibsdir)" \ + "$(DESTDIR)$(girepodir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES) \ $(pkgpyexec_LTLIBRARIES) am__DEPENDENCIES_1 = @@ -942,7 +943,7 @@ pkgpyexec_PYTHON = \ giscanner/ast.py \ giscanner/cachestore.py \ giscanner/codegen.py \ - giscanner/docmain.py \ + giscanner/docmain.py \ giscanner/docwriter.py \ giscanner/dumper.py \ giscanner/introspectablepass.py \ @@ -950,7 +951,6 @@ pkgpyexec_PYTHON = \ giscanner/girwriter.py \ giscanner/gdumpparser.py \ giscanner/libtoolimporter.py \ - giscanner/odict.py \ giscanner/maintransformer.py \ giscanner/message.py \ giscanner/shlibs.py \ @@ -962,6 +962,11 @@ pkgpyexec_PYTHON = \ giscanner/utils.py \ giscanner/xmlwriter.py +collectionsdir = $(pkgpyexecdir)/collections +collections_PYTHON = \ + giscanner/collections/__init__.py \ + giscanner/collections/ordereddict.py + templatedir = $(pkglibdir) nobase_dist_template_DATA = \ giscanner/doctemplates/base.tmpl \ @@ -1213,7 +1218,7 @@ GENERATED_MSVC_FILES = \ ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} SUBDIRS = . docs tests build DIST_SUBDIRS = m4 $(SUBDIRS) -DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc +DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-doctool pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gobject-introspection-1.0.pc gobject-introspection-no-export-1.0.pc m4dir = $(datadir)/aclocal @@ -1221,6 +1226,9 @@ m4_DATA = m4/introspection.m4 makedir = $(datadir)/gobject-introspection-1.0 dist_make_DATA = Makefile.introspection +# Default pep8.py --exclude + emacs backup files +PEP8_EXCLUDES = --exclude='.svn,CVS,.bzr,.hg,.git,__pycache__,.\#*' + # Colin's handy Makefile bits for: # 1) stuffing tarballs with pre-generated scripts from your workstation # 2) bumping configure.ac version post-release @@ -2129,6 +2137,54 @@ clean-libtool: distclean-libtool: -rm -f libtool config.lt +install-collectionsPYTHON: $(collections_PYTHON) + @$(NORMAL_INSTALL) + @list='$(collections_PYTHON)'; dlist=; list2=; test -n "$(collectionsdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(collectionsdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(collectionsdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then b=; else b="$(srcdir)/"; fi; \ + if test -f $$b$$p; then \ + $(am__strip_dir) \ + dlist="$$dlist $$f"; \ + list2="$$list2 $$b$$p"; \ + else :; fi; \ + done; \ + for file in $$list2; do echo $$file; done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(collectionsdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(collectionsdir)" || exit $$?; \ + done || exit $$?; \ + if test -n "$$dlist"; then \ + $(am__py_compile) --destdir "$(DESTDIR)" \ + --basedir "$(collectionsdir)" $$dlist; \ + else :; fi + +uninstall-collectionsPYTHON: + @$(NORMAL_UNINSTALL) + @list='$(collections_PYTHON)'; test -n "$(collectionsdir)" || list=; \ + py_files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$py_files" || exit 0; \ + dir='$(DESTDIR)$(collectionsdir)'; \ + pyc_files=`echo "$$py_files" | sed 's|$$|c|'`; \ + pyo_files=`echo "$$py_files" | sed 's|$$|o|'`; \ + py_files_pep3147=`echo "$$py_files" | $(am__pep3147_tweak)`; \ + echo "$$py_files_pep3147";\ + pyc_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|c|'`; \ + pyo_files_pep3147=`echo "$$py_files_pep3147" | sed 's|$$|o|'`; \ + st=0; \ + for files in \ + "$$py_files" \ + "$$pyc_files" \ + "$$pyo_files" \ + "$$pyc_files_pep3147" \ + "$$pyo_files_pep3147" \ + ; do \ + $(am__uninstall_files_from_dir) || st=$$?; \ + done; \ + exit $$st install-pkgpyexecPYTHON: $(pkgpyexec_PYTHON) @$(NORMAL_INSTALL) @list='$(pkgpyexec_PYTHON)'; dlist=; list2=; test -n "$(pkgpyexecdir)" || list=; \ @@ -2690,7 +2746,7 @@ install-binPROGRAMS: install-libLTLIBRARIES installdirs: installdirs-recursive installdirs-am: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(makedir)" "$(DESTDIR)$(gdumpdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(m4dir)" "$(DESTDIR)$(templatedir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(girepodir)"; do \ + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(collectionsdir)" "$(DESTDIR)$(pkgpyexecdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(makedir)" "$(DESTDIR)$(gdumpdir)" "$(DESTDIR)$(girdir)" "$(DESTDIR)$(m4dir)" "$(DESTDIR)$(templatedir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(typelibsdir)" "$(DESTDIR)$(girepodir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) @@ -2755,9 +2811,9 @@ info: info-recursive info-am: -install-data-am: install-dist_makeDATA install-gdumpDATA \ - install-girDATA install-girepoHEADERS install-m4DATA \ - install-man install-nobase_dist_templateDATA \ +install-data-am: install-collectionsPYTHON install-dist_makeDATA \ + install-gdumpDATA install-girDATA install-girepoHEADERS \ + install-m4DATA install-man install-nobase_dist_templateDATA \ install-pkgconfigDATA install-typelibsDATA install-dvi: install-dvi-recursive @@ -2809,9 +2865,9 @@ ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \ - uninstall-dist_makeDATA uninstall-gdumpDATA uninstall-girDATA \ - uninstall-girepoHEADERS uninstall-libLTLIBRARIES \ - uninstall-m4DATA uninstall-man \ + uninstall-collectionsPYTHON uninstall-dist_makeDATA \ + uninstall-gdumpDATA uninstall-girDATA uninstall-girepoHEADERS \ + uninstall-libLTLIBRARIES uninstall-m4DATA uninstall-man \ uninstall-nobase_dist_templateDATA uninstall-pkgconfigDATA \ uninstall-pkgpyexecLTLIBRARIES uninstall-pkgpyexecPYTHON \ uninstall-typelibsDATA @@ -2833,11 +2889,12 @@ uninstall-man: uninstall-man1 distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-binSCRIPTS \ - install-data install-data-am install-dist_makeDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-gdumpDATA \ - install-girDATA install-girepoHEADERS install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-m4DATA install-man install-man1 \ + install-collectionsPYTHON install-data install-data-am \ + install-dist_makeDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-gdumpDATA install-girDATA \ + install-girepoHEADERS install-html install-html-am \ + install-info install-info-am install-libLTLIBRARIES \ + install-m4DATA install-man install-man1 \ install-nobase_dist_templateDATA install-pdf install-pdf-am \ install-pkgconfigDATA install-pkgpyexecLTLIBRARIES \ install-pkgpyexecPYTHON install-ps install-ps-am install-strip \ @@ -2846,12 +2903,12 @@ uninstall-man: uninstall-man1 mostlyclean mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS \ - uninstall-dist_makeDATA uninstall-gdumpDATA uninstall-girDATA \ - uninstall-girepoHEADERS uninstall-libLTLIBRARIES \ - uninstall-m4DATA uninstall-man uninstall-man1 \ - uninstall-nobase_dist_templateDATA uninstall-pkgconfigDATA \ - uninstall-pkgpyexecLTLIBRARIES uninstall-pkgpyexecPYTHON \ - uninstall-typelibsDATA + uninstall-collectionsPYTHON uninstall-dist_makeDATA \ + uninstall-gdumpDATA uninstall-girDATA uninstall-girepoHEADERS \ + uninstall-libLTLIBRARIES uninstall-m4DATA uninstall-man \ + uninstall-man1 uninstall-nobase_dist_templateDATA \ + uninstall-pkgconfigDATA uninstall-pkgpyexecLTLIBRARIES \ + uninstall-pkgpyexecPYTHON uninstall-typelibsDATA # Make sure the required variables are set, these should under normal @@ -3147,12 +3204,14 @@ g-ir-doc-tool: tools/g-ir-doc-tool.in _giscanner.la Makefile check-local: gtester --verbose $(GTESTER_PROGS) @echo "TEST: PEP-8 INQUISITION" - @find $(top_srcdir)/giscanner -name \*.py | sort | uniq | xargs $(PYTHON) $(top_srcdir)/misc/pep8.py --repeat --exclude=config.py + @find $(top_srcdir)/giscanner -name \*.py | sort | uniq | xargs \ + $(PYTHON) $(top_srcdir)/misc/pep8.py --max-line-length=99 --ignore=E128 $(PEP8_EXCLUDES) + @find $(top_srcdir)/tests -name \*.py | sort | uniq | xargs \ + $(PYTHON) $(top_srcdir)/misc/pep8.py --ignore=E127,E501 $(PEP8_EXCLUDES) @echo "TEST: Annotation pattern programs" PYTHONPATH="$(top_builddir):$(top_srcdir)" $(PYTHON) $(top_srcdir)/tests/scanner/annotationparser/test_patterns.py @echo "TEST: GTK-Doc Annotation Parser" PYTHONPATH="$(top_builddir):$(top_srcdir)" $(PYTHON) $(top_srcdir)/tests/scanner/annotationparser/test_parser.py - @touch $(top_builddir)/.make-check-passed check-pyflakes: @echo " CHECK Pyflakes" diff --git a/build-aux/config.sub b/build-aux/config.sub index 802a224..52f04bc 100755 --- a/build-aux/config.sub +++ b/build-aux/config.sub @@ -1008,7 +1008,7 @@ case $basic_machine in ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-* | ppc64p7-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown diff --git a/build-aux/ltmain.sh b/build-aux/ltmain.sh index 63ae69d..0af9597 100644 --- a/build-aux/ltmain.sh +++ b/build-aux/ltmain.sh @@ -82,6 +82,7 @@ PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" +: ${DD=dd} package_revision=1.3337 # Be Bourne compatible @@ -1224,6 +1225,21 @@ func_enable_tag "$optarg" ## Main. ## ## ----------- ## +# func_try_sizelim file n +# try to write at most the first N bytes from FILE to the standard output when +# possible, otherwise put whole file +func_try_sizelim () +{ + if test -n "$DD"; then + $DD if="$1" bs=$2 count=1 2>/dev/null + if test $? -eq 127; then + cat "$1" 2>/dev/null + fi + else + cat "$1" 2>/dev/null + fi +} + # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out @@ -1231,7 +1247,7 @@ func_enable_tag "$optarg" func_lalib_p () { test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ + func_try_sizelim "$1" 4096 | $SED -e 4q 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } diff --git a/build/win32/vs10/gir.props b/build/win32/vs10/gir.props index 70457e4..71dd88a 100644 --- a/build/win32/vs10/gir.props +++ b/build/win32/vs10/gir.props @@ -106,7 +106,6 @@ copy ..\..\..\giscanner\girparser.py $(CopyDir)\lib\gobject-introspection\giscan copy ..\..\..\giscanner\girwriter.py $(CopyDir)\lib\gobject-introspection\giscanner copy ..\..\..\giscanner\gdumpparser.py $(CopyDir)\lib\gobject-introspection\giscanner copy ..\..\..\giscanner\libtoolimporter.py $(CopyDir)\lib\gobject-introspection\giscanner -copy ..\..\..\giscanner\odict.py $(CopyDir)\lib\gobject-introspection\giscanner copy ..\..\..\giscanner\maintransformer.py $(CopyDir)\lib\gobject-introspection\giscanner copy ..\..\..\giscanner\message.py $(CopyDir)\lib\gobject-introspection\giscanner copy ..\..\..\giscanner\shlibs.py $(CopyDir)\lib\gobject-introspection\giscanner diff --git a/build/win32/vs9/gir.vsprops b/build/win32/vs9/gir.vsprops index eb047fb..32a4b96 100644 --- a/build/win32/vs9/gir.vsprops +++ b/build/win32/vs9/gir.vsprops @@ -180,7 +180,6 @@ copy ..\..\..\giscanner\girparser.py $(CopyDir)\lib\gobject-introspection\giscan copy ..\..\..\giscanner\girwriter.py $(CopyDir)\lib\gobject-introspection\giscanner copy ..\..\..\giscanner\gdumpparser.py $(CopyDir)\lib\gobject-introspection\giscanner copy ..\..\..\giscanner\libtoolimporter.py $(CopyDir)\lib\gobject-introspection\giscanner -copy ..\..\..\giscanner\odict.py $(CopyDir)\lib\gobject-introspection\giscanner copy ..\..\..\giscanner\maintransformer.py $(CopyDir)\lib\gobject-introspection\giscanner copy ..\..\..\giscanner\message.py $(CopyDir)\lib\gobject-introspection\giscanner copy ..\..\..\giscanner\shlibs.py $(CopyDir)\lib\gobject-introspection\giscanner diff --git a/config.h.win32 b/config.h.win32 index 0b2f4ca..4adcdc6 100644 --- a/config.h.win32 +++ b/config.h.win32 @@ -96,7 +96,7 @@ #define PACKAGE_NAME "gobject-introspection" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "gojbect-introspection 1.36.0" +#define PACKAGE_STRING "gojbect-introspection 1.37.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "gobject-introspection" @@ -105,7 +105,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "1.36.0" +#define PACKAGE_VERSION "1.37.1" /* Define to the platform's shared library suffix */ #define SHLIB_SUFFIX ".dll" @@ -126,7 +126,7 @@ #define STDC_HEADERS 1 /* Version number of package */ -#define VERSION "1.36.0" +#define VERSION "1.37.1" /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ diff --git a/configure b/configure index f297b25..9711f07 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for gobject-introspection 1.36.0. +# Generated by GNU Autoconf 2.69 for gobject-introspection 1.37.1. # # Report bugs to . # @@ -591,8 +591,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gobject-introspection' PACKAGE_TARNAME='gobject-introspection' -PACKAGE_VERSION='1.36.0' -PACKAGE_STRING='gobject-introspection 1.36.0' +PACKAGE_VERSION='1.37.1' +PACKAGE_STRING='gobject-introspection 1.37.1' PACKAGE_BUGREPORT='http://bugzilla.gnome.org/enter_bug.cgi?product=glib&component=introspection' PACKAGE_URL='' @@ -1425,7 +1425,7 @@ if test "$ac_init_help" = "long"; then # 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 <<_ACEOF -\`configure' configures gobject-introspection 1.36.0 to adapt to many kinds of systems. +\`configure' configures gobject-introspection 1.37.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1496,7 +1496,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gobject-introspection 1.36.0:";; + short | recursive ) echo "Configuration of gobject-introspection 1.37.1:";; esac cat <<\_ACEOF @@ -1650,7 +1650,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gobject-introspection configure 1.36.0 +gobject-introspection configure 1.37.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2202,7 +2202,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gobject-introspection $as_me 1.36.0, which was +It was created by gobject-introspection $as_me 1.37.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3070,7 +3070,7 @@ fi # Define the identity of the package. PACKAGE='gobject-introspection' - VERSION='1.36.0' + VERSION='1.37.1' cat >>confdefs.h <<_ACEOF @@ -14336,13 +14336,13 @@ done if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 2.5" >&5 -$as_echo_n "checking whether $PYTHON version is >= 2.5... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 2.6" >&5 +$as_echo_n "checking whether $PYTHON version is >= 2.6... " >&6; } prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x -minver = list(map(int, '2.5'.split('.'))) + [0, 0, 0] +minver = list(map(int, '2.6'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] @@ -14363,8 +14363,8 @@ fi else # Otherwise, try each interpreter until we find one that satisfies # VERSION. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.5" >&5 -$as_echo_n "checking for a Python interpreter with version >= 2.5... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 2.6" >&5 +$as_echo_n "checking for a Python interpreter with version >= 2.6... " >&6; } if ${am_cv_pathless_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else @@ -14375,7 +14375,7 @@ else # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x -minver = list(map(int, '2.5'.split('.'))) + [0, 0, 0] +minver = list(map(int, '2.6'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] @@ -14623,7 +14623,7 @@ if test "x$os_win32" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libraries required to link against libpython" >&5 $as_echo_n "checking for libraries required to link against libpython... " >&6; } -if test "x$PYTHON_LIBS" == x; then +if test "x$PYTHON_LIBS" = x; then PYTHON_LIBS=`$PYTHON-config --ldflags --libs` fi @@ -15365,7 +15365,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gobject-introspection $as_me 1.36.0, which was +This file was extended by gobject-introspection $as_me 1.37.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15431,7 +15431,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -gobject-introspection config.status 1.36.0 +gobject-introspection config.status 1.37.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -17212,10 +17212,3 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi - -echo " - gobject-introspection $VERSION - =============== - - tests: ${enable_tests} -" diff --git a/configure.ac b/configure.ac index 3537af1..4a899c8 100644 --- a/configure.ac +++ b/configure.ac @@ -3,8 +3,8 @@ dnl the gi version number m4_define(gi_major_version, 1) -m4_define(gi_minor_version, 36) -m4_define(gi_micro_version, 0) +m4_define(gi_minor_version, 37) +m4_define(gi_micro_version, 1) m4_define(gi_version, gi_major_version.gi_minor_version.gi_micro_version) AC_PREREQ([2.63]) @@ -247,7 +247,7 @@ AC_CHECK_FUNCS([memchr strchr strspn strstr strtol strtoull]) AC_CHECK_FUNCS([backtrace backtrace_symbols]) # Python -AM_PATH_PYTHON([2.5]) +AM_PATH_PYTHON([2.6]) case "$host" in *-*-mingw*) # Change backslashes to forward slashes in pyexecdir to avoid @@ -328,10 +328,3 @@ build/win32/Makefile build/win32/vs9/Makefile build/win32/vs10/Makefile]) AC_OUTPUT - -echo " - gobject-introspection $VERSION - =============== - - tests: ${enable_tests} -" diff --git a/gir/gio-2.0.c b/gir/gio-2.0.c index d78bfdc..999b130 100644 --- a/gir/gio-2.0.c +++ b/gir/gio-2.0.c @@ -261,6 +261,13 @@ /** + * GBytesIcon:bytes: + * + * The bytes containing the icon. + */ + + +/** * GCancellable::cancelled: * @cancellable: a #GCancellable. * @@ -1897,6 +1904,16 @@ /** + * GProxyAddressEnumerator:default-port: + * + * The default port to use if #GProxyAddressEnumerator:uri does not + * specify one. + * + * Since: 2.38 + */ + + +/** * GProxyAddressEnumerator:proxy-resolver: * * The proxy resolver to use. @@ -3300,6 +3317,15 @@ /** + * SECTION:_GFreedesktopDBus + * @title: _GFreedesktopDBus + * @short_description: Generated C code for the org.freedesktop.DBus D-Bus interface + * + * This section contains code for working with the org.freedesktop.DBus D-Bus interface in C. + */ + + +/** * SECTION:extensionpoints * @short_description: Extension Points * @include: gio.h @@ -4018,6 +4044,19 @@ /** + * SECTION:gbytesicon + * @short_description: An icon stored in memory as a #GBytes + * @include: gio/gio.h + * @see_also: #GIcon, #GLoadableIcon, #GBytes + * + * #GBytesIcon specifies an image held in memory in a common format (usually + * png) to be used as icon. + * + * Since: 2.38 + */ + + +/** * SECTION:gcancellable * @short_description: Thread-safe Operation Cancellation Stack * @include: gio/gio.h @@ -5247,12 +5286,22 @@ * * To check if two #GIcons are equal, see g_icon_equal(). * - * For serializing a #GIcon, use g_icon_to_string() and - * g_icon_new_for_string(). + * For serializing a #GIcon, use g_icon_serialize() and + * g_icon_deserialize(). + * + * If you want to consume #GIcon (for example, in a toolkit) you must + * be prepared to handle at least the three following cases: + * #GLoadableIcon, #GThemedIcon and #GEmblemedIcon. It may also make + * sense to have fast-paths for other cases (like handling #GdkPixbuf + * directly, for example) but all compliant #GIcon implementations + * outside of GIO must implement #GLoadableIcon. * * If your application or library provides one or more #GIcon - * implementations you need to ensure that each #GType is registered - * with the type system prior to calling g_icon_new_for_string(). + * implementations you need to ensure that your new implementation also + * implements #GLoadableIcon. Additionally, you must provide an + * implementation of g_icon_serialize() that gives a result that is + * understood by g_icon_deserialize(), yielding one of the built-in icon + * types. */ @@ -6681,7 +6730,7 @@ * GSocketAddress *sockaddr; * GError *conn_error = NULL; * - * addr = g_network_address_new ("www.gnome.org", 80); + * addr = g_network_address_new (hostname, port); * enumerator = g_socket_connectable_enumerate (addr); * g_object_unref (addr); * @@ -7641,7 +7690,7 @@ * @include: gio/gio.h * * #GTlsFileDatabase is implemented by #GTlsDatabase objects which load - * their certificate information from a file. It is in interface which + * their certificate information from a file. It is an interface which * TLS library specific subtypes implement. * * Since: 2.30 @@ -7833,149 +7882,3035 @@ /** - * SECTION:gunixsocketaddress - * @short_description: UNIX GSocketAddress - * @include: gio/gunixsocketaddress.h + * SECTION:gunixsocketaddress + * @short_description: UNIX GSocketAddress + * @include: gio/gunixsocketaddress.h + * + * Support for UNIX-domain (also known as local) sockets. + * + * UNIX domain sockets are generally visible in the filesystem. + * However, some systems support abstract socket names which are not + * visible in the filesystem and not affected by the filesystem + * permissions, visibility, etc. Currently this is only supported + * under Linux. If you attempt to use abstract sockets on other + * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED + * errors. You can use g_unix_socket_address_abstract_names_supported() + * to see if abstract names are supported. + * + * Note that <gio/gunixsocketaddress.h> belongs to + * the UNIX-specific GIO interfaces, thus you have to use the + * gio-unix-2.0.pc pkg-config file when using it. + */ + + +/** + * SECTION:gvfs + * @short_description: Virtual File System + * @include: gio/gio.h + * + * Entry point for using GIO functionality. + */ + + +/** + * SECTION:gvolume + * @short_description: Volume management + * @include: gio/gio.h + * + * The #GVolume interface represents user-visible objects that can be + * mounted. Note, when porting from GnomeVFS, #GVolume is the moral + * equivalent of #GnomeVFSDrive. + * + * Mounting a #GVolume instance is an asynchronous operation. For more + * information about asynchronous operations, see #GAsyncResult and + * #GTask. To mount a #GVolume, first call g_volume_mount() with (at + * least) the #GVolume instance, optionally a #GMountOperation object + * and a #GAsyncReadyCallback. + * + * Typically, one will only want to pass %NULL for the + * #GMountOperation if automounting all volumes when a desktop session + * starts since it's not desirable to put up a lot of dialogs asking + * for credentials. + * + * The callback will be fired when the operation has resolved (either + * with success or failure), and a #GAsyncReady structure will be + * passed to the callback. That callback should then call + * g_volume_mount_finish() with the #GVolume instance and the + * #GAsyncReady data to see if the operation was completed + * successfully. If an @error is present when g_volume_mount_finish() + * is called, then it will be filled with any error information. + * + * + * It is sometimes necessary to directly access the underlying + * operating system object behind a volume (e.g. for passing a volume + * to an application via the commandline). For this purpose, GIO + * allows to obtain an 'identifier' for the volume. There can be + * different kinds of identifiers, such as Hal UDIs, filesystem labels, + * traditional Unix devices (e.g. /dev/sda2), + * uuids. GIO uses predefind strings as names for the different kinds + * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI, + * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier() + * to obtain an identifier for a volume. + * + * + * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available + * when the gvfs hal volume monitor is in use. Other volume monitors + * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE + * identifier, which can be used to obtain a hal device by means of + * libhal_manager_find_device_string_match(). + */ + + +/** + * SECTION:gvolumemonitor + * @short_description: Volume Monitor + * @include: gio/gio.h + * @see_also: #GFileMonitor + * + * #GVolumeMonitor is for listing the user interesting devices and volumes + * on the computer. In other words, what a file selector or file manager + * would show in a sidebar. + * + * #GVolumeMonitor is not thread-default-context + * aware, and so should not be used other than from the main + * thread, with no thread-default-context active. + */ + + +/** + * SECTION:gwin32inputstream + * @short_description: Streaming input operations for Windows file handles + * @include: gio/gwin32inputstream.h + * @see_also: #GInputStream + * + * #GWin32InputStream implements #GInputStream for reading from a + * Windows file handle. + * + * Note that <gio/gwin32inputstream.h> belongs + * to the Windows-specific GIO interfaces, thus you have to use the + * gio-windows-2.0.pc pkg-config file when using it. + */ + + +/** + * SECTION:gwin32outputstream + * @short_description: Streaming output operations for Windows file handles + * @include: gio/gwin32outputstream.h + * @see_also: #GOutputStream + * + * #GWin32OutputStream implements #GOutputStream for writing to a + * Windows file handle. + * + * Note that <gio/gwin32outputstream.h> belongs + * to the Windows-specific GIO interfaces, thus you have to use the + * gio-windows-2.0.pc pkg-config file when using it. + */ + + +/** + * SECTION:gzcompressor + * @short_description: Zlib compressor + * @include: gio/gio.h + * + * #GZlibCompressor is an implementation of #GConverter that + * compresses data using zlib. + */ + + +/** + * SECTION:gzdecompressor + * @short_description: Zlib decompressor + * @include: gio/gio.h + * + * #GZlibDecompressor is an implementation of #GConverter that + * decompresses data compressed with zlib. + */ + + +/** + * _GFreedesktopDBus: + * + * Abstract interface type for the D-Bus interface org.freedesktop.DBus. + */ + + +/** + * _GFreedesktopDBus::handle-add-match: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_rule: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the AddMatch() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_add_match() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-get-connection-selinux-security-context: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the GetConnectionSELinuxSecurityContext() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_selinux_security_context() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-get-connection-unix-process-id: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the GetConnectionUnixProcessID() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_unix_process_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-get-connection-unix-user: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the GetConnectionUnixUser() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_unix_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-get-id: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the GetId() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-get-name-owner: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the GetNameOwner() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_name_owner() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-hello: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the Hello() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_hello() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-list-activatable-names: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the ListActivatableNames() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_activatable_names() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-list-names: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the ListNames() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_names() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-list-queued-owners: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the ListQueuedOwners() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_queued_owners() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-name-has-owner: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the NameHasOwner() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_name_has_owner() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-release-name: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the ReleaseName() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_release_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-reload-config: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the ReloadConfig() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_reload_config() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-remove-match: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_rule: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the RemoveMatch() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_remove_match() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-request-name: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * @arg_flags: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the RequestName() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_request_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-start-service-by-name: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * @arg_flags: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the StartServiceByName() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_start_service_by_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-update-activation-environment: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_environment: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the UpdateActivationEnvironment() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_update_activation_environment() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::name-acquired: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "NameAcquired" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + + +/** + * _GFreedesktopDBus::name-lost: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "NameLost" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + + +/** + * _GFreedesktopDBus::name-owner-changed: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument. + * @arg_old_owner: Argument. + * @arg_new_owner: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "NameOwnerChanged" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + + +/** + * _GFreedesktopDBusIface: + * @parent_iface: The parent interface. + * @handle_add_match: Handler for the #_GFreedesktopDBus::handle-add-match signal. + * @handle_get_connection_selinux_security_context: Handler for the #_GFreedesktopDBus::handle-get-connection-selinux-security-context signal. + * @handle_get_connection_unix_process_id: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-process-id signal. + * @handle_get_connection_unix_user: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-user signal. + * @handle_get_id: Handler for the #_GFreedesktopDBus::handle-get-id signal. + * @handle_get_name_owner: Handler for the #_GFreedesktopDBus::handle-get-name-owner signal. + * @handle_hello: Handler for the #_GFreedesktopDBus::handle-hello signal. + * @handle_list_activatable_names: Handler for the #_GFreedesktopDBus::handle-list-activatable-names signal. + * @handle_list_names: Handler for the #_GFreedesktopDBus::handle-list-names signal. + * @handle_list_queued_owners: Handler for the #_GFreedesktopDBus::handle-list-queued-owners signal. + * @handle_name_has_owner: Handler for the #_GFreedesktopDBus::handle-name-has-owner signal. + * @handle_release_name: Handler for the #_GFreedesktopDBus::handle-release-name signal. + * @handle_reload_config: Handler for the #_GFreedesktopDBus::handle-reload-config signal. + * @handle_remove_match: Handler for the #_GFreedesktopDBus::handle-remove-match signal. + * @handle_request_name: Handler for the #_GFreedesktopDBus::handle-request-name signal. + * @handle_start_service_by_name: Handler for the #_GFreedesktopDBus::handle-start-service-by-name signal. + * @handle_update_activation_environment: Handler for the #_GFreedesktopDBus::handle-update-activation-environment signal. + * @name_acquired: Handler for the #_GFreedesktopDBus::name-acquired signal. + * @name_lost: Handler for the #_GFreedesktopDBus::name-lost signal. + * @name_owner_changed: Handler for the #_GFreedesktopDBus::name-owner-changed signal. + * + * Virtual table for the D-Bus interface org.freedesktop.DBus. + */ + + +/** + * _GFreedesktopDBusProxy: + * + * The #_GFreedesktopDBusProxy structure contains only private data and should only be accessed using the provided API. + */ + + +/** + * _GFreedesktopDBusProxyClass: + * @parent_class: The parent class. + * + * Class structure for #_GFreedesktopDBusProxy. + */ + + +/** + * _GFreedesktopDBusSkeleton: + * + * The #_GFreedesktopDBusSkeleton structure contains only private data and should only be accessed using the provided API. + */ + + +/** + * _GFreedesktopDBusSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #_GFreedesktopDBusSkeleton. + */ + + +/** + * _g_freedesktop_dbus_call_add_match: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_rule: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the AddMatch() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_add_match_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_add_match_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_add_match_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_add_match(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_add_match(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_add_match_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_rule: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the AddMatch() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_add_match() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_selinux_security_context: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetConnectionSELinuxSecurityContext() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_security_context: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_selinux_security_context(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_selinux_security_context(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_security_context: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetConnectionSELinuxSecurityContext() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_get_connection_selinux_security_context() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_process_id: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetConnectionUnixProcessID() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_get_connection_unix_process_id_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_get_connection_unix_process_id_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_process_id_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_pid: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_process_id(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_process_id(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_process_id_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_pid: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetConnectionUnixProcessID() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_get_connection_unix_process_id() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_user: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetConnectionUnixUser() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_get_connection_unix_user_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_get_connection_unix_user_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_user_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_uid: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_user(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_user(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_user_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_uid: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetConnectionUnixUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_get_connection_unix_user() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_id: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetId() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_get_id_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_get_id_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_get_id_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_unique_id: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_id(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_get_id(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_id_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_unique_id: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetId() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_get_id() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_name_owner: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetNameOwner() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_get_name_owner_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_get_name_owner_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_get_name_owner_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_unique_name: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_name_owner(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_get_name_owner(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_name_owner_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_unique_name: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetNameOwner() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_get_name_owner() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_hello: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the Hello() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_hello_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_hello_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_hello(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_hello(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_hello_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the Hello() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_hello() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_activatable_names: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ListActivatableNames() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_list_activatable_names_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_list_activatable_names_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_list_activatable_names_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_activatable_names(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_list_activatable_names(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_activatable_names_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ListActivatableNames() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_list_activatable_names() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_names: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ListNames() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_list_names_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_list_names_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_list_names_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_names: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_names(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_list_names(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_names_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_names: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ListNames() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_list_names() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_queued_owners: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ListQueuedOwners() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_list_queued_owners_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_list_queued_owners_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_list_queued_owners_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_queued_owners(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_list_queued_owners(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_queued_owners_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ListQueuedOwners() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_list_queued_owners() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_name_has_owner: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the NameHasOwner() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_name_has_owner_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_name_has_owner_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_name_has_owner_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_has_owner: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_name_has_owner(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_name_has_owner(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_name_has_owner_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_has_owner: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the NameHasOwner() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_name_has_owner() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_release_name: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ReleaseName() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_release_name_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_release_name_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_release_name_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_release_name(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_release_name(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_release_name_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ReleaseName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_release_name() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_reload_config: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ReloadConfig() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_reload_config_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_reload_config_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_reload_config_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_reload_config(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_reload_config(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_reload_config_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ReloadConfig() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_reload_config() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_remove_match: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_rule: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the RemoveMatch() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_remove_match_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_remove_match_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_remove_match_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_remove_match(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_remove_match(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_remove_match_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_rule: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the RemoveMatch() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_remove_match() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_request_name: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @arg_flags: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the RequestName() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_request_name_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_request_name_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_request_name_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_request_name(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_request_name(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_request_name_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @arg_flags: Argument to pass with the method invocation. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the RequestName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_request_name() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_start_service_by_name: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @arg_flags: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the StartServiceByName() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_start_service_by_name_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_start_service_by_name_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_start_service_by_name_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_start_service_by_name(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_start_service_by_name(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_start_service_by_name_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @arg_flags: Argument to pass with the method invocation. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the StartServiceByName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_start_service_by_name() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_update_activation_environment: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_environment: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the UpdateActivationEnvironment() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_update_activation_environment_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_update_activation_environment_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_update_activation_environment_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_update_activation_environment(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_update_activation_environment(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_update_activation_environment_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_environment: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the UpdateActivationEnvironment() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_update_activation_environment() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_complete_add_match: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the AddMatch() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_get_connection_selinux_security_context: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @security_context: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetConnectionSELinuxSecurityContext() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_get_connection_unix_process_id: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @pid: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetConnectionUnixProcessID() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_get_connection_unix_user: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @uid: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetConnectionUnixUser() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_get_id: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unique_id: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetId() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_get_name_owner: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unique_name: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetNameOwner() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_hello: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @assigned_name: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the Hello() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_list_activatable_names: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @activatable_names: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the ListActivatableNames() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_list_names: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @names: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the ListNames() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_list_queued_owners: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @queued_owners: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the ListQueuedOwners() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_name_has_owner: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @has_owner: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the NameHasOwner() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_release_name: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @value: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the ReleaseName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_reload_config: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the ReloadConfig() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_remove_match: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the RemoveMatch() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_request_name: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @value: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the RequestName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_start_service_by_name: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @value: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the StartServiceByName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_update_activation_environment: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the UpdateActivationEnvironment() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_emit_name_acquired: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument to pass with the signal. + * + * Emits the "NameAcquired" D-Bus signal. + */ + + +/** + * _g_freedesktop_dbus_emit_name_lost: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument to pass with the signal. + * + * Emits the "NameLost" D-Bus signal. + */ + + +/** + * _g_freedesktop_dbus_emit_name_owner_changed: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument to pass with the signal. + * @arg_old_owner: Argument to pass with the signal. + * @arg_new_owner: Argument to pass with the signal. + * + * Emits the "NameOwnerChanged" D-Bus signal. + */ + + +/** + * _g_freedesktop_dbus_interface_info: + * + * Gets a machine-readable description of the org.freedesktop.DBus D-Bus interface. + * + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. + */ + + +/** + * _g_freedesktop_dbus_override_properties: + * @klass: The class structure for a #GObject-derived class. + * @property_id_begin: The property id to assign to the first overridden property. + * + * Overrides all #GObject properties in the #_GFreedesktopDBus interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. + */ + + +/** + * _g_freedesktop_dbus_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Asynchronously creates a proxy for the D-Bus interface org.freedesktop.DBus. See g_dbus_proxy_new() for more details. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_proxy_new_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ + + +/** + * _g_freedesktop_dbus_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with _g_freedesktop_dbus_proxy_new(). + * + * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. + */ + + +/** + * _g_freedesktop_dbus_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. + * + * Like _g_freedesktop_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection. + * + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_proxy_new_for_bus_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. + */ + + +/** + * _g_freedesktop_dbus_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new_for_bus(). + * @error: Return location for error or %NULL + * + * Finishes an operation started with _g_freedesktop_dbus_proxy_new_for_bus(). + * + * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. + */ + + +/** + * _g_freedesktop_dbus_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Like _g_freedesktop_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. + * + * The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. + */ + + +/** + * _g_freedesktop_dbus_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL + * + * Synchronously creates a proxy for the D-Bus interface org.freedesktop.DBus. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. + */ + + +/** + * _g_freedesktop_dbus_skeleton_new: + * + * Creates a skeleton object for the D-Bus interface org.freedesktop.DBus. + * + * Returns: (transfer full) (type _GFreedesktopDBusSkeleton): The skeleton object. + */ + + +/** + * _GFreedesktopDBus: + * + * Abstract interface type for the D-Bus interface org.freedesktop.DBus. + */ + + +/** + * _GFreedesktopDBus::handle-add-match: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_rule: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the AddMatch() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_add_match() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-get-connection-selinux-security-context: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the GetConnectionSELinuxSecurityContext() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_selinux_security_context() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-get-connection-unix-process-id: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the GetConnectionUnixProcessID() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_unix_process_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-get-connection-unix-user: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the GetConnectionUnixUser() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_connection_unix_user() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-get-id: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the GetId() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_id() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-get-name-owner: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the GetNameOwner() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_get_name_owner() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-hello: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the Hello() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_hello() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-list-activatable-names: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the ListActivatableNames() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_activatable_names() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-list-names: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the ListNames() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_names() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-list-queued-owners: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the ListQueuedOwners() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_list_queued_owners() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-name-has-owner: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the NameHasOwner() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_name_has_owner() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-release-name: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the ReleaseName() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_release_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-reload-config: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * + * Signal emitted when a remote caller is invoking the ReloadConfig() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_reload_config() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-remove-match: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_rule: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the RemoveMatch() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_remove_match() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-request-name: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * @arg_flags: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the RequestName() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_request_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-start-service-by-name: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_name: Argument passed by remote caller. + * @arg_flags: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the StartServiceByName() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_start_service_by_name() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::handle-update-activation-environment: + * @object: A #_GFreedesktopDBus. + * @invocation: A #GDBusMethodInvocation. + * @arg_environment: Argument passed by remote caller. + * + * Signal emitted when a remote caller is invoking the UpdateActivationEnvironment() D-Bus method. + * + * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call _g_freedesktop_dbus_complete_update_activation_environment() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned. + * + * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run. + */ + + +/** + * _GFreedesktopDBus::name-acquired: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "NameAcquired" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + + +/** + * _GFreedesktopDBus::name-lost: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "NameLost" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + + +/** + * _GFreedesktopDBus::name-owner-changed: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument. + * @arg_old_owner: Argument. + * @arg_new_owner: Argument. + * + * On the client-side, this signal is emitted whenever the D-Bus signal "NameOwnerChanged" is received. + * + * On the service-side, this signal can be used with e.g. g_signal_emit_by_name() to make the object emit the D-Bus signal. + */ + + +/** + * _GFreedesktopDBusIface: + * @parent_iface: The parent interface. + * @handle_add_match: Handler for the #_GFreedesktopDBus::handle-add-match signal. + * @handle_get_connection_selinux_security_context: Handler for the #_GFreedesktopDBus::handle-get-connection-selinux-security-context signal. + * @handle_get_connection_unix_process_id: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-process-id signal. + * @handle_get_connection_unix_user: Handler for the #_GFreedesktopDBus::handle-get-connection-unix-user signal. + * @handle_get_id: Handler for the #_GFreedesktopDBus::handle-get-id signal. + * @handle_get_name_owner: Handler for the #_GFreedesktopDBus::handle-get-name-owner signal. + * @handle_hello: Handler for the #_GFreedesktopDBus::handle-hello signal. + * @handle_list_activatable_names: Handler for the #_GFreedesktopDBus::handle-list-activatable-names signal. + * @handle_list_names: Handler for the #_GFreedesktopDBus::handle-list-names signal. + * @handle_list_queued_owners: Handler for the #_GFreedesktopDBus::handle-list-queued-owners signal. + * @handle_name_has_owner: Handler for the #_GFreedesktopDBus::handle-name-has-owner signal. + * @handle_release_name: Handler for the #_GFreedesktopDBus::handle-release-name signal. + * @handle_reload_config: Handler for the #_GFreedesktopDBus::handle-reload-config signal. + * @handle_remove_match: Handler for the #_GFreedesktopDBus::handle-remove-match signal. + * @handle_request_name: Handler for the #_GFreedesktopDBus::handle-request-name signal. + * @handle_start_service_by_name: Handler for the #_GFreedesktopDBus::handle-start-service-by-name signal. + * @handle_update_activation_environment: Handler for the #_GFreedesktopDBus::handle-update-activation-environment signal. + * @name_acquired: Handler for the #_GFreedesktopDBus::name-acquired signal. + * @name_lost: Handler for the #_GFreedesktopDBus::name-lost signal. + * @name_owner_changed: Handler for the #_GFreedesktopDBus::name-owner-changed signal. + * + * Virtual table for the D-Bus interface org.freedesktop.DBus. + */ + + +/** + * _GFreedesktopDBusProxy: + * + * The #_GFreedesktopDBusProxy structure contains only private data and should only be accessed using the provided API. + */ + + +/** + * _GFreedesktopDBusProxyClass: + * @parent_class: The parent class. + * + * Class structure for #_GFreedesktopDBusProxy. + */ + + +/** + * _GFreedesktopDBusSkeleton: + * + * The #_GFreedesktopDBusSkeleton structure contains only private data and should only be accessed using the provided API. + */ + + +/** + * _GFreedesktopDBusSkeletonClass: + * @parent_class: The parent class. + * + * Class structure for #_GFreedesktopDBusSkeleton. + */ + + +/** + * _g_freedesktop_dbus_call_add_match: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_rule: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the AddMatch() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_add_match_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_add_match_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_add_match_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_add_match(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_add_match(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_add_match_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_rule: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the AddMatch() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_add_match() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_selinux_security_context: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetConnectionSELinuxSecurityContext() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_selinux_security_context_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_security_context: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_selinux_security_context(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_selinux_security_context(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_selinux_security_context_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_security_context: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetConnectionSELinuxSecurityContext() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_get_connection_selinux_security_context() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_process_id: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetConnectionUnixProcessID() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_get_connection_unix_process_id_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_get_connection_unix_process_id_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_process_id_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_pid: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_process_id(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_process_id(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_process_id_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_pid: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetConnectionUnixProcessID() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_get_connection_unix_process_id() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_user: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetConnectionUnixUser() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_get_connection_unix_user_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_get_connection_unix_user_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_user_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_uid: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_connection_unix_user(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_get_connection_unix_user(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_connection_unix_user_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_uid: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetConnectionUnixUser() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_get_connection_unix_user() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_id: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetId() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_get_id_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_get_id_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_get_id_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_unique_id: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_id(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_get_id(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_id_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_unique_id: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetId() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_get_id() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_name_owner: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the GetNameOwner() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_get_name_owner_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_get_name_owner_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_get_name_owner_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_unique_name: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_get_name_owner(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_get_name_owner(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_get_name_owner_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_unique_name: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the GetNameOwner() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_get_name_owner() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_hello: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the Hello() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_hello_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_hello_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_hello_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_hello(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_hello(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_hello_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_assigned_name: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the Hello() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_hello() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_activatable_names: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ListActivatableNames() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_list_activatable_names_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_list_activatable_names_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_list_activatable_names_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_activatable_names(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_list_activatable_names(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_activatable_names_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_activatable_names: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ListActivatableNames() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_list_activatable_names() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_names: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ListNames() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_list_names_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_list_names_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_list_names_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_names: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_names(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_list_names(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_names_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_names: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ListNames() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_list_names() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_queued_owners: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ListQueuedOwners() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_list_queued_owners_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_list_queued_owners_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_list_queued_owners_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_list_queued_owners(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_list_queued_owners(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_list_queued_owners_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_queued_owners: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ListQueuedOwners() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_list_queued_owners() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_name_has_owner: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the NameHasOwner() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_name_has_owner_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_name_has_owner_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_name_has_owner_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_has_owner: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_name_has_owner(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_name_has_owner(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_name_has_owner_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_has_owner: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the NameHasOwner() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_name_has_owner() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_release_name: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ReleaseName() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_release_name_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_release_name_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_release_name_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_release_name(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_release_name(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_release_name_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ReleaseName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_release_name() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_reload_config: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the ReloadConfig() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_reload_config_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_reload_config_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_reload_config_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_reload_config(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_reload_config(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_reload_config_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the ReloadConfig() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_reload_config() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_remove_match: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_rule: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the RemoveMatch() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_remove_match_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_remove_match_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_remove_match_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_remove_match(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_remove_match(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_remove_match_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_rule: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the RemoveMatch() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_remove_match() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_request_name: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @arg_flags: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the RequestName() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_request_name_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_request_name_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_request_name_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_request_name(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_request_name(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_request_name_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @arg_flags: Argument to pass with the method invocation. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the RequestName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_request_name() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_start_service_by_name: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @arg_flags: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the StartServiceByName() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_start_service_by_name_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_start_service_by_name_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_start_service_by_name_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_start_service_by_name(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_start_service_by_name(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_start_service_by_name_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_name: Argument to pass with the method invocation. + * @arg_flags: Argument to pass with the method invocation. + * @out_value: (out): Return location for return parameter or %NULL to ignore. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the StartServiceByName() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_start_service_by_name() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_update_activation_environment: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_environment: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL. + * @user_data: User data to pass to @callback. + * + * Asynchronously invokes the UpdateActivationEnvironment() D-Bus method on @proxy. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_call_update_activation_environment_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_call_update_activation_environment_sync() for the synchronous, blocking version of this method. + */ + + +/** + * _g_freedesktop_dbus_call_update_activation_environment_finish: + * @proxy: A #_GFreedesktopDBusProxy. + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_call_update_activation_environment(). + * @error: Return location for error or %NULL. + * + * Finishes an operation started with _g_freedesktop_dbus_call_update_activation_environment(). + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_call_update_activation_environment_sync: + * @proxy: A #_GFreedesktopDBusProxy. + * @arg_environment: Argument to pass with the method invocation. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL. + * + * Synchronously invokes the UpdateActivationEnvironment() D-Bus method on @proxy. The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_call_update_activation_environment() for the asynchronous version of this method. + * + * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set. + */ + + +/** + * _g_freedesktop_dbus_complete_add_match: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the AddMatch() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_get_connection_selinux_security_context: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @security_context: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetConnectionSELinuxSecurityContext() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_get_connection_unix_process_id: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @pid: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetConnectionUnixProcessID() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_get_connection_unix_user: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @uid: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetConnectionUnixUser() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_get_id: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unique_id: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetId() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_get_name_owner: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @unique_name: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the GetNameOwner() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_hello: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @assigned_name: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the Hello() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_list_activatable_names: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @activatable_names: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the ListActivatableNames() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_list_names: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @names: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the ListNames() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_list_queued_owners: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @queued_owners: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the ListQueuedOwners() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_name_has_owner: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @has_owner: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the NameHasOwner() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_release_name: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @value: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the ReleaseName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_reload_config: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the ReloadConfig() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_remove_match: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the RemoveMatch() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_request_name: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @value: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the RequestName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_start_service_by_name: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * @value: Parameter to return. + * + * Helper function used in service implementations to finish handling invocations of the StartServiceByName() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_complete_update_activation_environment: + * @object: A #_GFreedesktopDBus. + * @invocation: (transfer full): A #GDBusMethodInvocation. + * + * Helper function used in service implementations to finish handling invocations of the UpdateActivationEnvironment() D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar. + * + * This method will free @invocation, you cannot use it afterwards. + */ + + +/** + * _g_freedesktop_dbus_emit_name_acquired: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument to pass with the signal. + * + * Emits the "NameAcquired" D-Bus signal. + */ + + +/** + * _g_freedesktop_dbus_emit_name_lost: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument to pass with the signal. + * + * Emits the "NameLost" D-Bus signal. + */ + + +/** + * _g_freedesktop_dbus_emit_name_owner_changed: + * @object: A #_GFreedesktopDBus. + * @arg_name: Argument to pass with the signal. + * @arg_old_owner: Argument to pass with the signal. + * @arg_new_owner: Argument to pass with the signal. * - * Support for UNIX-domain (also known as local) sockets. + * Emits the "NameOwnerChanged" D-Bus signal. + */ + + +/** + * _g_freedesktop_dbus_interface_info: * - * UNIX domain sockets are generally visible in the filesystem. - * However, some systems support abstract socket names which are not - * visible in the filesystem and not affected by the filesystem - * permissions, visibility, etc. Currently this is only supported - * under Linux. If you attempt to use abstract sockets on other - * systems, function calls may return %G_IO_ERROR_NOT_SUPPORTED - * errors. You can use g_unix_socket_address_abstract_names_supported() - * to see if abstract names are supported. + * Gets a machine-readable description of the org.freedesktop.DBus D-Bus interface. * - * Note that <gio/gunixsocketaddress.h> belongs to - * the UNIX-specific GIO interfaces, thus you have to use the - * gio-unix-2.0.pc pkg-config file when using it. + * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free. */ /** - * SECTION:gvfs - * @short_description: Virtual File System - * @include: gio/gio.h + * _g_freedesktop_dbus_override_properties: + * @klass: The class structure for a #GObject-derived class. + * @property_id_begin: The property id to assign to the first overridden property. * - * Entry point for using GIO functionality. + * Overrides all #GObject properties in the #_GFreedesktopDBus interface for a concrete class. + * The properties are overridden in the order they are defined. + * + * Returns: The last property id. */ /** - * SECTION:gvolume - * @short_description: Volume management - * @include: gio/gio.h - * - * The #GVolume interface represents user-visible objects that can be - * mounted. Note, when porting from GnomeVFS, #GVolume is the moral - * equivalent of #GnomeVFSDrive. + * _g_freedesktop_dbus_proxy_new: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. * - * Mounting a #GVolume instance is an asynchronous operation. For more - * information about asynchronous operations, see #GAsyncResult and - * #GTask. To mount a #GVolume, first call g_volume_mount() with (at - * least) the #GVolume instance, optionally a #GMountOperation object - * and a #GAsyncReadyCallback. + * Asynchronously creates a proxy for the D-Bus interface org.freedesktop.DBus. See g_dbus_proxy_new() for more details. * - * Typically, one will only want to pass %NULL for the - * #GMountOperation if automounting all volumes when a desktop session - * starts since it's not desirable to put up a lot of dialogs asking - * for credentials. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_proxy_new_finish() to get the result of the operation. * - * The callback will be fired when the operation has resolved (either - * with success or failure), and a #GAsyncReady structure will be - * passed to the callback. That callback should then call - * g_volume_mount_finish() with the #GVolume instance and the - * #GAsyncReady data to see if the operation was completed - * successfully. If an @error is present when g_volume_mount_finish() - * is called, then it will be filled with any error information. + * See _g_freedesktop_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor. + */ + + +/** + * _g_freedesktop_dbus_proxy_new_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new(). + * @error: Return location for error or %NULL * - * - * It is sometimes necessary to directly access the underlying - * operating system object behind a volume (e.g. for passing a volume - * to an application via the commandline). For this purpose, GIO - * allows to obtain an 'identifier' for the volume. There can be - * different kinds of identifiers, such as Hal UDIs, filesystem labels, - * traditional Unix devices (e.g. /dev/sda2), - * uuids. GIO uses predefind strings as names for the different kinds - * of identifiers: #G_VOLUME_IDENTIFIER_KIND_HAL_UDI, - * #G_VOLUME_IDENTIFIER_KIND_LABEL, etc. Use g_volume_get_identifier() - * to obtain an identifier for a volume. - * + * Finishes an operation started with _g_freedesktop_dbus_proxy_new(). * - * Note that #G_VOLUME_IDENTIFIER_KIND_HAL_UDI will only be available - * when the gvfs hal volume monitor is in use. Other volume monitors - * will generally be able to provide the #G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE - * identifier, which can be used to obtain a hal device by means of - * libhal_manager_find_device_string_match(). + * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. */ /** - * SECTION:gvolumemonitor - * @short_description: Volume Monitor - * @include: gio/gio.h - * @see_also: #GFileMonitor + * _g_freedesktop_dbus_proxy_new_for_bus: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @callback: A #GAsyncReadyCallback to call when the request is satisfied. + * @user_data: User data to pass to @callback. * - * #GVolumeMonitor is for listing the user interesting devices and volumes - * on the computer. In other words, what a file selector or file manager - * would show in a sidebar. + * Like _g_freedesktop_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection. * - * #GVolumeMonitor is not thread-default-context - * aware, and so should not be used other than from the main - * thread, with no thread-default-context active. + * When the operation is finished, @callback will be invoked in the thread-default main loop of the thread you are calling this method from. + * You can then call _g_freedesktop_dbus_proxy_new_for_bus_finish() to get the result of the operation. + * + * See _g_freedesktop_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor. */ /** - * SECTION:gwin32inputstream - * @short_description: Streaming input operations for Windows file handles - * @include: gio/gwin32inputstream.h - * @see_also: #GInputStream + * _g_freedesktop_dbus_proxy_new_for_bus_finish: + * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to _g_freedesktop_dbus_proxy_new_for_bus(). + * @error: Return location for error or %NULL * - * #GWin32InputStream implements #GInputStream for reading from a - * Windows file handle. + * Finishes an operation started with _g_freedesktop_dbus_proxy_new_for_bus(). * - * Note that <gio/gwin32inputstream.h> belongs - * to the Windows-specific GIO interfaces, thus you have to use the - * gio-windows-2.0.pc pkg-config file when using it. + * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. */ /** - * SECTION:gwin32outputstream - * @short_description: Streaming output operations for Windows file handles - * @include: gio/gwin32outputstream.h - * @see_also: #GOutputStream + * _g_freedesktop_dbus_proxy_new_for_bus_sync: + * @bus_type: A #GBusType. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: A bus name (well-known or unique). + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL * - * #GWin32OutputStream implements #GOutputStream for writing to a - * Windows file handle. + * Like _g_freedesktop_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection. * - * Note that <gio/gwin32outputstream.h> belongs - * to the Windows-specific GIO interfaces, thus you have to use the - * gio-windows-2.0.pc pkg-config file when using it. + * The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_proxy_new_for_bus() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. */ /** - * SECTION:gzcompressor - * @short_description: Zlib compressor - * @include: gio/gio.h + * _g_freedesktop_dbus_proxy_new_sync: + * @connection: A #GDBusConnection. + * @flags: Flags from the #GDBusProxyFlags enumeration. + * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection. + * @object_path: An object path. + * @cancellable: (allow-none): A #GCancellable or %NULL. + * @error: Return location for error or %NULL * - * #GZlibCompressor is an implementation of #GConverter that - * compresses data using zlib. + * Synchronously creates a proxy for the D-Bus interface org.freedesktop.DBus. See g_dbus_proxy_new_sync() for more details. + * + * The calling thread is blocked until a reply is received. + * + * See _g_freedesktop_dbus_proxy_new() for the asynchronous version of this constructor. + * + * Returns: (transfer full) (type _GFreedesktopDBusProxy): The constructed proxy object or %NULL if @error is set. */ /** - * SECTION:gzdecompressor - * @short_description: Zlib decompressor - * @include: gio/gio.h + * _g_freedesktop_dbus_skeleton_new: * - * #GZlibDecompressor is an implementation of #GConverter that - * decompresses data compressed with zlib. + * Creates a skeleton object for the D-Bus interface org.freedesktop.DBus. + * + * Returns: (transfer full) (type _GFreedesktopDBusSkeleton): The skeleton object. */ @@ -8041,6 +10976,8 @@ * the parameter type given at construction time). If the parameter * type was %NULL then @parameter must also be %NULL. * + * If the @parameter GVariant is floating, it is consumed. + * * Since: 2.28 */ @@ -8548,6 +11485,38 @@ /** + * g_action_parse_detailed_name: + * @detailed_name: a detailed action name + * @action_name: (out): the action name + * @target_value: (out): the target value, or %NULL for no target + * @error: a pointer to a %NULL #GError, or %NULL + * + * Parses a detailed action name into its separate name and target + * components. + * + * Detailed action names can have three formats. + * + * The first format is used to represent an action name with no target + * value and consists of just an action name containing no whitespace + * nor the characters ':', '(' or ')'. For example: "app.action". + * + * The second format is used to represent an action with a string-typed + * target value. The action name and target value are separated by a + * double colon ("::"). For example: "app.action::target". + * + * The third format is used to represent an action with an + * arbitrarily-typed target value. The target value follows the action + * name, surrounded in parens. For example: "app.action(42)". The + * target value is parsed using g_variant_parse(). If a tuple-typed + * value is desired, it must be specified in the same way, resulting in + * two sets of parens, for example: "app.action((1,2,3))". + * + * Returns: %TRUE if successful, else %FALSE with @error set + * Since: 2.38 + */ + + +/** * g_app_info_add_supports_type: * @appinfo: a #GAppInfo. * @content_type: a string. @@ -9494,6 +12463,25 @@ /** + * g_application_mark_busy: + * @application: a #GApplication + * + * Increases the busy count of @application. + * + * Use this function to indicate that the application is busy, for instance + * while a long running operation is pending. + * + * The busy state will be exposed to other processes, so a session shell will + * use that information to indicate the state to the user (e.g. with a + * spinner). + * + * To cancel the busy indication, use g_application_unmark_busy(). + * + * Since: 2.38 + */ + + +/** * g_application_new: * @application_id: (allow-none): the application id * @flags: the application flags @@ -9770,6 +12758,22 @@ /** + * g_application_unmark_busy: + * @application: a #GApplication + * + * Decreases the busy count of @application. + * + * When the busy count reaches zero, the new state will be propagated + * to other processes. + * + * This function must only be called to cancel the effect of a previous + * call to g_application_mark_busy(). + * + * Since: 2.38 + */ + + +/** * g_async_initable_init_async: * @initable: a #GAsyncInitable. * @io_priority: the I/O priority of the operation. @@ -10501,6 +13505,28 @@ /** + * g_bytes_icon_get_bytes: + * @icon: a #GIcon. + * + * Gets the #GBytes associated with the given @icon. + * + * Returns: (transfer none): a #GBytes, or %NULL. + * Since: 2.38 + */ + + +/** + * g_bytes_icon_new: + * @bytes: a #GBytes. + * + * Creates a new icon for a bytes. + * + * Returns: (transfer full) (type GBytesIcon): a #GIcon for the given @bytes, or %NULL on error. + * Since: 2.38 + */ + + +/** * g_cancellable_cancel: * @cancellable: a #GCancellable object. * @@ -12963,6 +15989,11 @@ * tracking the name owner of the well-known name and use that when * processing the received signal. * + * If one of %G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_NAMESPACE or + * %G_DBUS_SIGNAL_FLAGS_MATCH_ARG0_PATH are given, @arg0 is + * interpreted as part of a namespace or path. The first argument + * of a signal is matched against that part as specified by D-Bus. + * * Returns: A subscription identifier that can be used with g_dbus_connection_signal_unsubscribe(). * Since: 2.26 */ @@ -17097,6 +20128,7 @@ * Finishes deleting a file started with g_file_delete_async(). * * Virtual: delete_file_finish + * Returns: %TRUE if the file was deleted. %FALSE otherwise. * Since: 2.34 */ @@ -18717,6 +21749,36 @@ /** + * g_file_make_directory_async: + * @file: input #GFile + * @io_priority: the I/O priority of the request + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore + * @callback: a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: the data to pass to callback function + * + * Asynchronously creates a directory. + * + * Virtual: make_directory_async + * Since: 2.38 + */ + + +/** + * g_file_make_directory_finish: + * @file: input #GFile + * @result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous directory creation, started with + * g_file_make_directory_async(). + * + * Virtual: make_directory_finish + * Returns: %TRUE on successful directory creation, %FALSE otherwise. + * Since: 2.38 + */ + + +/** * g_file_make_directory_with_parents: * @file: input #GFile * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore @@ -20196,7 +23258,38 @@ * triggering the cancellable object from another thread. If the operation * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. * + * Virtual: trash + * Returns: %TRUE on successful trash, %FALSE otherwise. + */ + + +/** + * g_file_trash_async: + * @file: input #GFile + * @io_priority: the I/O priority of the request + * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore + * @callback: a #GAsyncReadyCallback to call when the request is satisfied + * @user_data: the data to pass to callback function + * + * Asynchronously sends @file to the Trash location, if possible. + * + * Virtual: trash_async + * Since: 2.38 + */ + + +/** + * g_file_trash_finish: + * @file: input #GFile + * @result: a #GAsyncResult + * @error: a #GError, or %NULL + * + * Finishes an asynchronous file trashing operation, started with + * g_file_trash_async(). + * + * Virtual: trash_finish * Returns: %TRUE on successful trash, %FALSE otherwise. + * Since: 2.38 */ @@ -20380,6 +23473,17 @@ /** + * g_icon_deserialize: + * @value: a #GVariant created with g_icon_serialize() + * + * Deserializes a #GIcon previously serialized using g_icon_serialize(). + * + * Returns: (transfer full): a #GIcon, or %NULL when deserialization fails. + * Since: 2.38 + */ + + +/** * g_icon_equal: * @icon1: (allow-none): pointer to the first #GIcon. * @icon2: (allow-none): pointer to the second #GIcon. @@ -20419,6 +23523,21 @@ /** + * g_icon_serialize: + * @icon: a #GIcon + * + * Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved + * back by calling g_icon_deserialize() on the returned value. + * As serialization will avoid using raw icon data when possible, it only + * makes sense to transfer the #GVariant between processes on the same machine, + * (as opposed to over the network), and within the same file system namespace. + * + * Returns: (transfer full): a #GVariant, or %NULL when serialization fails. + * Since: 2.38 + */ + + +/** * g_icon_to_string: * @icon: a #GIcon. * @@ -22632,14 +25751,8 @@ * * Sets the "action" and possibly the "target" attribute of @menu_item. * - * If @detailed_action contains a double colon ("::") then it is used as - * a separator between an action name and a target string. In this - * case, this call is equivalent to calling - * g_menu_item_set_action_and_target() with the part before the "::" and - * with a string-type #GVariant containing the part following the "::". - * - * If @detailed_action doesn't contain "::" then the action is set to - * the given string (verbatim) and the target value is unset. + * The format of @detailed_action is the same format parsed by + * g_action_parse_detailed_name(). * * See g_menu_item_set_action_and_target() or * g_menu_item_set_action_and_target_value() for more flexible (but @@ -22653,6 +25766,28 @@ /** + * g_menu_item_set_icon: + * @menu_item: a #GMenuItem + * @icon: a #GIcon, or %NULL + * + * Sets (or unsets) the icon on @menu_item. + * + * This call is the same as calling g_icon_serialize() and using the + * result as the value to g_menu_item_set_attribute_value() for + * %G_MENU_ATTRIBUTE_ICON. + * + * This API is only intended for use with "noun" menu items; things like + * bookmarks or applications in an "Open With" menu. Don't use it on + * menu items corresponding to verbs (eg: stock icons for 'Save' or + * 'Quit'). + * + * If @icon is %NULL then the icon is unset. + * + * Since: 2.38 + */ + + +/** * g_menu_item_set_label: * @menu_item: a #GMenuItem * @label: (allow-none): the label to set, or %NULL to unset @@ -23032,6 +26167,16 @@ /** + * g_menu_remove_all: + * @menu: a #GMenu + * + * Removes all items in the menu. + * + * Since: 2.38 + */ + + +/** * g_mount_can_eject: * @mount: a #GMount. * @@ -27079,6 +30224,8 @@ * property. Instead, they should call g_action_change_state() to * request the change. * + * If the @value GVariant is floating, it is consumed. + * * Since: 2.30 */ diff --git a/gir/glib-2.0.c b/gir/glib-2.0.c index dc98af0..ac8f779 100644 --- a/gir/glib-2.0.c +++ b/gir/glib-2.0.c @@ -429,7 +429,7 @@ * @G_FILE_ERROR_NFILE: There are too many distinct file openings in the entire system. * @G_FILE_ERROR_BADF: Bad file descriptor; for example, I/O on a descriptor that has been closed or reading from a descriptor open only for writing (or vice versa). * @G_FILE_ERROR_INVAL: Invalid argument. This is used to indicate various kinds of problems with passing the wrong argument to a library function. - * @G_FILE_ERROR_PIPE: Broken pipe; there is no process reading from the other end of a pipe. Every library function that returns this error code also generates a `SIGPIPE' signal; this signal terminates the program if not handled or blocked. Thus, your program will never actually see this code unless it has handled or blocked `SIGPIPE'. + * @G_FILE_ERROR_PIPE: Broken pipe; there is no process reading from the other end of a pipe. Every library function that returns this error code also generates a 'SIGPIPE' signal; this signal terminates the program if not handled or blocked. Thus, your program will never actually see this code unless it has handled or blocked 'SIGPIPE'. * @G_FILE_ERROR_AGAIN: Resource temporarily unavailable; the call might work if you try again later. * @G_FILE_ERROR_INTR: Interrupted function call; an asynchronous signal occurred and prevented completion of the call. When this happens, you should try the call again. * @G_FILE_ERROR_IO: Input/output error; usually used for physical read or write errors. i.e. the disk or other physical device hardware is returning errors. @@ -1790,6 +1790,19 @@ /** + * GTestSubprocessFlags: + * @G_TEST_SUBPROCESS_INHERIT_STDIN: If this flag is given, the child process will inherit the parent's stdin. Otherwise, the child's stdin is redirected to /dev/null. + * @G_TEST_SUBPROCESS_INHERIT_STDOUT: If this flag is given, the child process will inherit the parent's stdout. Otherwise, the child's stdout will not be visible, but it will be captured to allow later tests with g_test_trap_assert_stdout(). + * @G_TEST_SUBPROCESS_INHERIT_STDERR: If this flag is given, the child process will inherit the parent's stderr. Otherwise, the child's stderr will not be visible, but it will be captured to allow later tests with g_test_trap_assert_stderr(). + * + * Flags to pass to g_test_trap_subprocess() to control input and output. + * + * Note that in contrast with g_test_trap_fork(), the default is to + * not show stdout and stderr. + */ + + +/** * GTestSuite: * * An opaque structure representing a test suite. @@ -1800,10 +1813,12 @@ * GTestTrapFlags: * @G_TEST_TRAP_SILENCE_STDOUT: Redirect stdout of the test child to /dev/null so it cannot be observed on the console during test runs. The actual output is still captured though to allow later tests with g_test_trap_assert_stdout(). * @G_TEST_TRAP_SILENCE_STDERR: Redirect stderr of the test child to /dev/null so it cannot be observed on the console during test runs. The actual output is still captured though to allow later tests with g_test_trap_assert_stderr(). - * @G_TEST_TRAP_INHERIT_STDIN: If this flag is given, stdin of the forked child process is shared with stdin of its parent process. It is redirected to /dev/null otherwise. + * @G_TEST_TRAP_INHERIT_STDIN: If this flag is given, stdin of the child process is shared with stdin of its parent process. It is redirected to /dev/null otherwise. * * Test traps are guards around forked tests. * These flags determine what traps to set. + * + * Deprecated: #GTestTrapFlags is used only with g_test_trap_fork(), which is deprecated. g_test_trap_subprocess() uses #GTestTrapSubprocessFlags. */ @@ -1898,7 +1913,7 @@ /** * GTimeZone: * - * #GDateTime is an opaque structure whose members cannot be accessed + * #GTimeZone is an opaque structure whose members cannot be accessed * directly. * * Since: 2.26 @@ -2877,7 +2892,7 @@ * format function the same as they would have been for the unmodified * string). * - * Place the attribute after the function declaration, just after the + * Place the attribute after the function declaration, just before the * semicolon. * * See the GNU C documentation for more details. @@ -9827,9 +9842,9 @@ * @bookmark: a #GBookmarkFile * @uri: a valid URI * @name: an application's name - * @exec: (allow-none): location for the command line of the application, or %NULL - * @count: (allow-none): return location for the registration count, or %NULL - * @stamp: (allow-none): return location for the last registration time, or %NULL + * @exec: (allow-none) (out): return location for the command line of the application, or %NULL + * @count: (allow-none) (out): return location for the registration count, or %NULL + * @stamp: (allow-none) (out): return location for the last registration time, or %NULL * @error: return location for a #GError, or %NULL * * Gets the registration informations of @app_name for the bookmark for @@ -9855,7 +9870,7 @@ * g_bookmark_file_get_applications: * @bookmark: a #GBookmarkFile * @uri: a valid URI - * @length: (allow-none): return location of the length of the returned list, or %NULL + * @length: (allow-none) (out): return location of the length of the returned list, or %NULL * @error: return location for a #GError, or %NULL * * Retrieves the names of the applications that have registered the @@ -9864,7 +9879,7 @@ * In the event the URI cannot be found, %NULL is returned and * @error is set to #G_BOOKMARK_FILE_ERROR_URI_NOT_FOUND. * - * Returns: a newly allocated %NULL-terminated array of strings. Use g_strfreev() to free it. + * Returns: (array length=length) (transfer full): a newly allocated %NULL-terminated array of strings. Use g_strfreev() to free it. * Since: 2.12 */ @@ -9889,7 +9904,7 @@ * g_bookmark_file_get_groups: * @bookmark: a #GBookmarkFile * @uri: a valid URI - * @length: (allow-none): return location for the length of the returned string, or %NULL + * @length: (allow-none) (out): return location for the length of the returned string, or %NULL * @error: return location for a #GError, or %NULL * * Retrieves the list of group names of the bookmark for @uri. @@ -9900,7 +9915,7 @@ * The returned array is %NULL terminated, so @length may optionally * be %NULL. * - * Returns: a newly allocated %NULL-terminated array of group names. Use g_strfreev() to free it. + * Returns: (array length=length) (transfer full): a newly allocated %NULL-terminated array of group names. Use g_strfreev() to free it. * Since: 2.12 */ @@ -9909,8 +9924,8 @@ * g_bookmark_file_get_icon: * @bookmark: a #GBookmarkFile * @uri: a valid URI - * @href: (allow-none): return location for the icon's location or %NULL - * @mime_type: (allow-none): return location for the icon's MIME type or %NULL + * @href: (allow-none) (out): return location for the icon's location or %NULL + * @mime_type: (allow-none) (out): return location for the icon's MIME type or %NULL * @error: return location for a #GError or %NULL * * Gets the icon of the bookmark for @uri. @@ -10007,13 +10022,13 @@ /** * g_bookmark_file_get_uris: * @bookmark: a #GBookmarkFile - * @length: (allow-none): return location for the number of returned URIs, or %NULL + * @length: (allow-none) (out): return location for the number of returned URIs, or %NULL * * Returns all URIs of the bookmarks in the bookmark file @bookmark. * The array of returned URIs will be %NULL-terminated, so @length may * optionally be %NULL. * - * Returns: a newly allocated %NULL-terminated array of strings. Use g_strfreev() to free it. + * Returns: (array length=length) (transfer full): a newly allocated %NULL-terminated array of strings. Use g_strfreev() to free it. * Since: 2.12 */ @@ -10412,7 +10427,7 @@ /** * g_bookmark_file_to_data: * @bookmark: a #GBookmarkFile - * @length: (allow-none): return location for the length of the returned string, or %NULL + * @length: (allow-none) (out): return location for the length of the returned string, or %NULL * @error: return location for a #GError, or %NULL * * This function outputs @bookmark as a string. @@ -27201,6 +27216,11 @@ * slash-separated portions of @testpath. The @test_data argument * will be passed as first argument to @test_func. * + * If @testpath includes the component "subprocess" anywhere in it, + * the test will be skipped by default, and only run if explicitly + * required via the command-line option or + * g_test_trap_subprocess(). + * * Since: 2.16 */ @@ -27229,6 +27249,11 @@ * created on the fly and added to the root fixture, based on the * slash-separated portions of @testpath. * + * If @testpath includes the component "subprocess" anywhere in it, + * the test will be skipped by default, and only run if explicitly + * required via the command-line option or + * g_test_trap_subprocess(). + * * Since: 2.16 */ @@ -27349,7 +27374,7 @@ * * Note that you cannot use this to test g_error() messages, since * g_error() intentionally never returns even if the program doesn't - * abort; use g_test_trap_fork() in this case. + * abort; use g_test_trap_subprocess() in this case. * * Since: 2.34 */ @@ -27421,6 +27446,8 @@ * * * Execute all tests matching TESTPATH. + * This can also be used to force a test to run that would otherwise + * be skipped (ie, a test whose name contains "/subprocess"). * * * @@ -27451,8 +27478,8 @@ * undefined * * Tests for undefined behaviour, may provoke programming errors - * under g_test_trap_fork() to check that appropriate assertions - * or warnings are given + * under g_test_trap_subprocess() or g_test_expect_messages() to check + * that appropriate assertions or warnings are given * * * @@ -27766,6 +27793,17 @@ /** + * g_test_subprocess: + * + * Returns %TRUE (after g_test_init() has been called) if the test + * program is running under g_test_trap_subprocess(). + * + * Returns: %TRUE if the test program is running under g_test_trap_subprocess(). + * Since: 2.38 + */ + + +/** * g_test_suite_add: * @suite: a #GTestSuite * @test_case: a #GTestCase @@ -27830,13 +27868,13 @@ /** * g_test_trap_assert_failed: * - * Assert that the last forked test failed. - * See g_test_trap_fork(). + * Assert that the last test subprocess failed. + * See g_test_trap_subprocess(). * * This is sometimes used to test situations that are formally considered to * be undefined behaviour, like inputs that fail a g_return_if_fail() * check. In these situations you should skip the entire test, including the - * call to g_test_trap_fork(), unless g_test_undefined() returns %TRUE + * call to g_test_trap_subprocess(), unless g_test_undefined() returns %TRUE * to indicate that undefined behaviour may be tested. * * Since: 2.16 @@ -27846,8 +27884,8 @@ /** * g_test_trap_assert_passed: * - * Assert that the last forked test passed. - * See g_test_trap_fork(). + * Assert that the last test subprocess passed. + * See g_test_trap_subprocess(). * * Since: 2.16 */ @@ -27857,14 +27895,15 @@ * g_test_trap_assert_stderr: * @serrpattern: a glob-style pattern * - * Assert that the stderr output of the last forked test - * matches @serrpattern. See g_test_trap_fork(). + * Assert that the stderr output of the last test subprocess + * matches @serrpattern. See g_test_trap_subprocess(). * - * This is sometimes used to test situations that are formally considered to - * be undefined behaviour, like inputs that fail a g_return_if_fail() - * check. In these situations you should skip the entire test, including the - * call to g_test_trap_fork(), unless g_test_undefined() returns %TRUE - * to indicate that undefined behaviour may be tested. + * This is sometimes used to test situations that are formally + * considered to be undefined behaviour, like code that hits a + * g_assert() or g_error(). In these situations you should skip the + * entire test, including the call to g_test_trap_subprocess(), unless + * g_test_undefined() returns %TRUE to indicate that undefined + * behaviour may be tested. * * Since: 2.16 */ @@ -27874,8 +27913,8 @@ * g_test_trap_assert_stderr_unmatched: * @serrpattern: a glob-style pattern * - * Assert that the stderr output of the last forked test - * does not match @serrpattern. See g_test_trap_fork(). + * Assert that the stderr output of the last test subprocess + * does not match @serrpattern. See g_test_trap_subprocess(). * * Since: 2.16 */ @@ -27885,8 +27924,8 @@ * g_test_trap_assert_stdout: * @soutpattern: a glob-style pattern * - * Assert that the stdout output of the last forked test matches - * @soutpattern. See g_test_trap_fork(). + * Assert that the stdout output of the last test subprocess matches + * @soutpattern. See g_test_trap_subprocess(). * * Since: 2.16 */ @@ -27896,8 +27935,8 @@ * g_test_trap_assert_stdout_unmatched: * @soutpattern: a glob-style pattern * - * Assert that the stdout output of the last forked test - * does not match @soutpattern. See g_test_trap_fork(). + * Assert that the stdout output of the last test subprocess + * does not match @soutpattern. See g_test_trap_subprocess(). * * Since: 2.16 */ @@ -27909,8 +27948,10 @@ * @test_trap_flags: Flags to modify forking behaviour. * * Fork the current test program to execute a test case that might - * not return or that might abort. The forked test case is aborted - * and considered failing if its run time exceeds @usec_timeout. + * not return or that might abort. + * + * If @usec_timeout is non-0, the forked test case is aborted and + * considered failing if its run time exceeds it. * * The forking behavior can be configured with the #GTestTrapFlags flags. * @@ -27929,25 +27970,24 @@ * g_printerr ("some stderr text: semagic43\n"); * exit (0); /* successful test run */ * } - * g_test_trap_assert_passed(); + * g_test_trap_assert_passed (); * g_test_trap_assert_stdout ("*somagic17*"); * g_test_trap_assert_stderr ("*semagic43*"); * } * ]| * - * This function is implemented only on Unix platforms. - * * Returns: %TRUE for the forked child and %FALSE for the executing parent process. * Since: 2.16 + * Deprecated: This function is implemented only on Unix platforms, and is not always reliable due to problems inherent in fork-without-exec. Use g_test_trap_subprocess() instead. */ /** * g_test_trap_has_passed: * - * Check the result of the last g_test_trap_fork() call. + * Check the result of the last g_test_trap_subprocess() call. * - * Returns: %TRUE if the last forked child terminated successfully. + * Returns: %TRUE if the last test subprocess terminated successfully. * Since: 2.16 */ @@ -27955,20 +27995,91 @@ /** * g_test_trap_reached_timeout: * - * Check the result of the last g_test_trap_fork() call. + * Check the result of the last g_test_trap_subprocess() call. * - * Returns: %TRUE if the last forked child got killed due to a fork timeout. + * Returns: %TRUE if the last test subprocess got killed due to a timeout. * Since: 2.16 */ /** + * g_test_trap_subprocess: + * @test_name: Test to run in a subprocess + * @usec_timeout: Timeout for the subprocess test in micro seconds. + * @test_flags: Flags to modify subprocess behaviour. + * + * Respawns the test program to run only @test_name in a subprocess. + * This can be used for a test case that might not return, or that + * might abort. @test_name will normally be the name of the parent + * test, followed by "/subprocess/" and then a name + * for the specific subtest (or just ending with + * "/subprocess" if the test only has one child + * test); tests with names of this form will automatically be skipped + * in the parent process. + * + * If @usec_timeout is non-0, the test subprocess is aborted and + * considered failing if its run time exceeds it. + * + * The subprocess behavior can be configured with the + * #GTestSubprocessFlags flags. + * + * You can use methods such as g_test_trap_assert_passed(), + * g_test_trap_assert_failed(), and g_test_trap_assert_stderr() to + * check the results of the subprocess. (But note that + * g_test_trap_assert_stdout() and g_test_trap_assert_stderr() + * cannot be used if @test_flags specifies that the child should + * inherit the parent stdout/stderr.) + * + * If your main () needs to behave differently in + * the subprocess, you can call g_test_subprocess() (after calling + * g_test_init()) to see whether you are in a subprocess. + * + * The following example tests that calling + * my_object_new(1000000) will abort with an error + * message. + * + * |[ + * static void + * test_create_large_object_subprocess (void) + * { + * my_object_new (1000000); + * } + * + * static void + * test_create_large_object (void) + * { + * g_test_trap_subprocess ("/myobject/create_large_object/subprocess", 0, 0); + * g_test_trap_assert_failed (); + * g_test_trap_assert_stderr ("*ERROR*too large*"); + * } + * + * int + * main (int argc, char **argv) + * { + * g_test_init (&argc, &argv, NULL); + * + * g_test_add_func ("/myobject/create_large_object", + * test_create_large_object); + * /* Because of the '/subprocess' in the name, this test will + * * not be run by the g_test_run () call below. + * */ + * g_test_add_func ("/myobject/create_large_object/subprocess", + * test_create_large_object_subprocess); + * + * return g_test_run (); + * } + * ]| + * + * Since: 2.38 + */ + + +/** * g_test_undefined: * * Returns %TRUE if tests may provoke assertions and other formally-undefined - * behaviour under g_test_trap_fork(), to verify that appropriate warnings - * are given. It can be useful to turn this off if running tests under - * valgrind. + * behaviour, to verify that appropriate warnings are given. It might, in some + * cases, be useful to turn this off if running tests under valgrind. * * Returns: %TRUE if tests may provoke programming errors */ @@ -32283,7 +32394,7 @@ * * A reference is taken on @bytes. * - * Returns: a new #GVariant with a floating reference + * Returns: (transfer none): a new #GVariant with a floating reference * Since: 2.36 */ @@ -32532,6 +32643,26 @@ /** + * g_variant_new_take_string: (skip) + * @string: a normal utf8 nul-terminated string + * + * Creates a string #GVariant with the contents of @string. + * + * @string must be valid utf8. + * + * This function consumes @string. g_free() will be called on @string + * when it is no longer required. + * + * You must not modify or access @string in any other way after passing + * it to this function. It is even possible that @string is immediately + * freed. + * + * Returns: (transfer none): a floating reference to a new string #GVariant instance + * Since: 2.38 + */ + + +/** * g_variant_new_tuple: * @children: (array length=n_children): the items to make the tuple out of * @n_children: the length of @children diff --git a/gir/gobject-2.0.c b/gir/gobject-2.0.c index 05d5ee0..59892f0 100644 --- a/gir/gobject-2.0.c +++ b/gir/gobject-2.0.c @@ -210,6 +210,11 @@ * either one of the #GObject instances it refers to are finalized, or when * the #GBinding instance loses its last reference. * + * Bindings for languages with garbage collection can use + * g_binding_unbind() to explicitly release a binding between the source + * and target properties, instead of relying on the last reference on the + * binding, source, and target instances to drop. + * * #GBinding is available since GObject 2.26 */ @@ -764,6 +769,19 @@ /** + * g_binding_unbind: + * @binding: a #GBinding + * + * Explicitly releases the binding between the source and the target + * property expressed by @binding. + * + * This function does not change the reference count of @binding. + * + * Since: 2.38 + */ + + +/** * g_boxed_copy: * @boxed_type: The type of @src_boxed. * @src_boxed: The boxed structure to be copied. @@ -2698,6 +2716,19 @@ /** + * g_param_get_default_value: + * @param: a #GParamSpec + * + * Gets the default value of @param as a pointer to a #GValue. + * + * The #GValue will remain value for the life of @param. + * + * Returns: a pointer to a #GValue which must not be modified + * Since: 2.38 + */ + + +/** * g_param_spec_boolean: * @name: canonical name of the property specified * @nick: nick name for the property specified @@ -4320,6 +4351,24 @@ /** + * g_type_class_get_instance_private_offset: (skip) + * @g_class: a #GTypeClass + * + * Gets the offset of the private data for instances of @g_class. + * + * This is how many bytes you should add to the instance pointer of a + * class in order to get the private data for the type represented by + * @g_class. + * + * You can only call this function after you have registered a private + * data area for @g_class using g_type_class_add_private(). + * + * Returns: the offset, in bytes + * Since: 2.38 + */ + + +/** * g_type_class_peek: * @type: Type ID of a classed type. * @@ -5155,7 +5204,8 @@ * Sort @value_array using @compare_func to compare the elements according to * the semantics of #GCompareFunc. * - * The current implementation uses Quick-Sort as sorting algorithm. + * The current implementation uses the same sorting algorithm as standard + * C qsort() function. * * Returns: (transfer none): the #GValueArray passed in as @value_array * Deprecated: 2.32: Use #GArray and g_array_sort(). @@ -5171,7 +5221,8 @@ * Sort @value_array using @compare_func to compare the elements according * to the semantics of #GCompareDataFunc. * - * The current implementation uses Quick-Sort as sorting algorithm. + * The current implementation uses the same sorting algorithm as standard + * C qsort() function. * * Rename to: g_value_array_sort * Returns: (transfer none): the #GValueArray passed in as @value_array diff --git a/girepository/gdump.c b/girepository/gdump.c index 7e02d39..88942f3 100644 --- a/girepository/gdump.c +++ b/girepository/gdump.c @@ -38,6 +38,9 @@ #include static void +escaped_printf (GOutputStream *out, const char *fmt, ...) G_GNUC_PRINTF (2, 3); + +static void escaped_printf (GOutputStream *out, const char *fmt, ...) { char *str; diff --git a/girepository/gibaseinfo.c b/girepository/gibaseinfo.c index ff9c939..37893e6 100644 --- a/girepository/gibaseinfo.c +++ b/girepository/gibaseinfo.c @@ -226,7 +226,7 @@ g_base_info_ref (GIBaseInfo *info) GIRealInfo *rinfo = (GIRealInfo*)info; g_assert (rinfo->ref_count != INVALID_REFCOUNT); - ((GIRealInfo*)info)->ref_count++; + g_atomic_int_inc (&rinfo->ref_count); return info; } @@ -244,21 +244,20 @@ g_base_info_unref (GIBaseInfo *info) GIRealInfo *rinfo = (GIRealInfo*)info; g_assert (rinfo->ref_count > 0 && rinfo->ref_count != INVALID_REFCOUNT); - rinfo->ref_count--; - if (!rinfo->ref_count) - { - if (rinfo->container && ((GIRealInfo *) rinfo->container)->ref_count != INVALID_REFCOUNT) - g_base_info_unref (rinfo->container); + if (!g_atomic_int_dec_and_test (&rinfo->ref_count)) + return; - if (rinfo->repository) - g_object_unref (rinfo->repository); + if (rinfo->container && ((GIRealInfo *) rinfo->container)->ref_count != INVALID_REFCOUNT) + g_base_info_unref (rinfo->container); - if (rinfo->type == GI_INFO_TYPE_UNRESOLVED) - g_slice_free (GIUnresolvedInfo, (GIUnresolvedInfo *) rinfo); - else - g_slice_free (GIRealInfo, rinfo); - } + if (rinfo->repository) + g_object_unref (rinfo->repository); + + if (rinfo->type == GI_INFO_TYPE_UNRESOLVED) + g_slice_free (GIUnresolvedInfo, (GIUnresolvedInfo *) rinfo); + else + g_slice_free (GIRealInfo, rinfo); } /** diff --git a/girepository/girepository-private.h b/girepository/girepository-private.h index 275776d..bbd34e3 100644 --- a/girepository/girepository-private.h +++ b/girepository/girepository-private.h @@ -33,6 +33,11 @@ typedef struct _GIRealInfo GIRealInfo; +/* We changed a gint32 -> gint in the structure below, which should be + * valid everywhere we care about. + */ +G_STATIC_ASSERT (sizeof (int) == sizeof (gint32)); + /* * We just use one structure for all of the info object * types; in general, we should be reading data directly @@ -43,7 +48,7 @@ struct _GIRealInfo { /* Keep this part in sync with GIUnresolvedInfo below */ gint32 type; - gint32 ref_count; + volatile gint ref_count; GIRepository *repository; GIBaseInfo *container; @@ -62,7 +67,7 @@ struct _GIUnresolvedInfo { /* Keep this part in sync with GIBaseInfo above */ gint32 type; - gint32 ref_count; + volatile gint ref_count; GIRepository *repository; GIBaseInfo *container; diff --git a/girepository/girepository.c b/girepository/girepository.c index ccdd361..0922fb0 100644 --- a/girepository/girepository.c +++ b/girepository/girepository.c @@ -593,28 +593,39 @@ g_irepository_get_info (GIRepository *repository, } typedef struct { - GIRepository *repository; - GType type; - - gboolean fastpass; + const gchar *gtype_name; GITypelib *result_typelib; - DirEntry *result; + gboolean found_prefix; } FindByGTypeData; -static void -find_by_gtype_foreach (gpointer key, - gpointer value, - gpointer datap) +static DirEntry * +find_by_gtype (GHashTable *table, FindByGTypeData *data, gboolean check_prefix) { - GITypelib *typelib = (GITypelib*)value; - FindByGTypeData *data = datap; + GHashTableIter iter; + gpointer key, value; + DirEntry *ret; - if (data->result != NULL) - return; + g_hash_table_iter_init (&iter, table); + while (g_hash_table_iter_next (&iter, &key, &value)) + { + GITypelib *typelib = (GITypelib*)value; + if (check_prefix) + { + if (!g_typelib_matches_gtype_name_prefix (typelib, data->gtype_name)) + continue; - data->result = g_typelib_get_dir_entry_by_gtype (typelib, data->fastpass, data->type); - if (data->result) - data->result_typelib = typelib; + data->found_prefix = TRUE; + } + + ret = g_typelib_get_dir_entry_by_gtype_name (typelib, data->gtype_name); + if (ret) + { + data->result_typelib = typelib; + return ret; + } + } + + return NULL; } /** @@ -637,6 +648,7 @@ g_irepository_find_by_gtype (GIRepository *repository, { FindByGTypeData data; GIBaseInfo *cached; + DirEntry *entry; repository = get_repository (repository); @@ -646,30 +658,55 @@ g_irepository_find_by_gtype (GIRepository *repository, if (cached != NULL) return g_base_info_ref (cached); - data.repository = repository; - data.fastpass = TRUE; - data.type = gtype; + data.gtype_name = g_type_name (gtype); data.result_typelib = NULL; - data.result = NULL; + data.found_prefix = FALSE; + + /* There is a corner case regarding GdkRectangle. GdkRectangle is a + * boxed type, but it is just an alias to boxed struct + * CairoRectangleInt. Scanner automatically converts all references + * to GdkRectangle to CairoRectangleInt, so GdkRectangle does not + * appear in the typelibs at all, although user code might query it. + * So if we get such query, we also change it to lookup of + * CairoRectangleInt. + * https://bugzilla.gnome.org/show_bug.cgi?id=655423 + */ + if (G_UNLIKELY (!strcmp (data.gtype_name, "GdkRectangle"))) + data.gtype_name = "CairoRectangleInt"; + + /* Inside each typelib, we include the "C prefix" which acts as + * a namespace mechanism. For GtkTreeView, the C prefix is Gtk. + * Given the assumption that GTypes for a library also use the + * C prefix, we know we can skip examining a typelib if our + * target type does not have this typelib's C prefix. Use this + * assumption as our first attempt at locating the DirEntry. + */ + entry = find_by_gtype (repository->priv->typelibs, &data, TRUE); + if (entry == NULL) + entry = find_by_gtype (repository->priv->lazy_typelibs, &data, TRUE); - g_hash_table_foreach (repository->priv->typelibs, find_by_gtype_foreach, &data); - if (data.result == NULL) - g_hash_table_foreach (repository->priv->lazy_typelibs, find_by_gtype_foreach, &data); + /* If we have no result, but we did find a typelib claiming to + * offer bindings for such a prefix, bail out now on the assumption + * that a more exhaustive search would not produce any results. + */ + if (entry == NULL && data.found_prefix) + return NULL; - /* We do two passes; see comment in find_interface */ - if (data.result == NULL) - { - data.fastpass = FALSE; - g_hash_table_foreach (repository->priv->typelibs, find_by_gtype_foreach, &data); - } - if (data.result == NULL) - g_hash_table_foreach (repository->priv->lazy_typelibs, find_by_gtype_foreach, &data); + /* Not ever class library necessarily specifies a correct c_prefix, + * so take a second pass. This time we will try a global lookup, + * ignoring prefixes. + * See http://bugzilla.gnome.org/show_bug.cgi?id=564016 + */ + if (entry == NULL) + entry = find_by_gtype (repository->priv->typelibs, &data, FALSE); + if (entry == NULL) + entry = find_by_gtype (repository->priv->lazy_typelibs, &data, FALSE); - if (data.result != NULL) + if (entry != NULL) { - cached = _g_info_new_full (data.result->blob_type, + cached = _g_info_new_full (entry->blob_type, repository, - NULL, data.result_typelib, data.result->offset); + NULL, data.result_typelib, entry->offset); g_hash_table_insert (repository->priv->info_by_gtype, (gpointer) gtype, diff --git a/girepository/girparser.c b/girepository/girparser.c index 5aaa6dd..f96cfb1 100644 --- a/girepository/girparser.c +++ b/girepository/girparser.c @@ -2872,6 +2872,9 @@ start_element_handler (GMarkupParseContext *context, version = find_attribute ("version", attribute_names, attribute_values); shared_library = find_attribute ("shared-library", attribute_names, attribute_values); cprefix = find_attribute ("c:identifier-prefixes", attribute_names, attribute_values); + /* Backwards compatibility; vala currently still generates this */ + if (cprefix == NULL) + cprefix = find_attribute ("c:prefix", attribute_names, attribute_values); if (name == NULL) MISSING_ATTRIBUTE (context, error, element_name, "name"); diff --git a/girepository/gitypelib-internal.h b/girepository/gitypelib-internal.h index 04662b4..ac71008 100644 --- a/girepository/gitypelib-internal.h +++ b/girepository/gitypelib-internal.h @@ -1126,13 +1126,15 @@ DirEntry *g_typelib_get_dir_entry (GITypelib *typelib, DirEntry *g_typelib_get_dir_entry_by_name (GITypelib *typelib, const char *name); -DirEntry *g_typelib_get_dir_entry_by_gtype (GITypelib *typelib, - gboolean fastpass, - GType gtype); +DirEntry *g_typelib_get_dir_entry_by_gtype_name (GITypelib *typelib, + const gchar *gtype_name); DirEntry *g_typelib_get_dir_entry_by_error_domain (GITypelib *typelib, GQuark error_domain); +gboolean g_typelib_matches_gtype_name_prefix (GITypelib *typelib, + const gchar *gtype_name); + void g_typelib_check_sanity (void); #define g_typelib_get_string(typelib,offset) ((const gchar*)&(typelib->data)[(offset)]) diff --git a/girepository/gitypelib.c b/girepository/gitypelib.c index 76a55de..d88924a 100644 --- a/girepository/gitypelib.c +++ b/girepository/gitypelib.c @@ -198,55 +198,17 @@ g_typelib_get_dir_entry_by_name (GITypelib *typelib, } DirEntry * -g_typelib_get_dir_entry_by_gtype (GITypelib *typelib, - gboolean fastpass, - GType gtype) +g_typelib_get_dir_entry_by_gtype_name (GITypelib *typelib, + const gchar *gtype_name) { Header *header = (Header *)typelib->data; - guint n_entries = header->n_local_entries; - const char *gtype_name = g_type_name (gtype); - DirEntry *entry; guint i; - const char *c_prefix; - /* There is a corner case regarding GdkRectangle. GdkRectangle is a - boxed type, but it is just an alias to boxed struct - CairoRectangleInt. Scanner automatically converts all references - to GdkRectangle to CairoRectangleInt, so GdkRectangle does not - appear in the typelibs at all, although user code might query it. - So if we get such query, we also change it to lookup of - CairoRectangleInt. - https://bugzilla.gnome.org/show_bug.cgi?id=655423 */ - if (!fastpass && !strcmp (gtype_name, "GdkRectangle")) - gtype_name = "CairoRectangleInt"; - - /* Inside each typelib, we include the "C prefix" which acts as - * a namespace mechanism. For GtkTreeView, the C prefix is Gtk. - * Given the assumption that GTypes for a library also use the - * C prefix, we know we can skip examining a typelib if our - * target type does not have this typelib's C prefix. - * - * However, not every class library necessarily conforms to this, - * e.g. Clutter has Cogl inside it. So, we split this into two - * passes. First we try a lookup, skipping things which don't - * have the prefix. If that fails then we try a global lookup, - * ignoring the prefix. - * - * See http://bugzilla.gnome.org/show_bug.cgi?id=564016 - */ - c_prefix = g_typelib_get_string (typelib, header->c_prefix); - if (fastpass && c_prefix != NULL) - { - if (g_ascii_strncasecmp (c_prefix, gtype_name, strlen (c_prefix)) != 0) - return NULL; - } - - for (i = 1; i <= n_entries; i++) + for (i = 1; i <= header->n_local_entries; i++) { RegisteredTypeBlob *blob; const char *type; - - entry = g_typelib_get_dir_entry (typelib, i); + DirEntry *entry = g_typelib_get_dir_entry (typelib, i); if (!BLOB_IS_REGISTERED_TYPE (entry)) continue; @@ -261,6 +223,110 @@ g_typelib_get_dir_entry_by_gtype (GITypelib *typelib, return NULL; } +typedef struct { + const char *s; + const char *separator; + gsize sep_len; + GString buf; +} StrSplitIter; + +static void +strsplit_iter_init (StrSplitIter *iter, + const char *s, + const char *separator) +{ + iter->s = s; + iter->separator = separator; + iter->sep_len = strlen (separator); + iter->buf.str = NULL; + iter->buf.len = 0; + iter->buf.allocated_len = 0; +} + +static gboolean +strsplit_iter_next (StrSplitIter *iter, + char **out_val) +{ + const char *s = iter->s; + const char *next; + gsize len; + + if (!s) + return FALSE; + next = strstr (s, iter->separator); + if (next) + { + iter->s = next + iter->sep_len; + len = next - s; + } + else + { + iter->s = NULL; + len = strlen (s); + } + if (len == 0) + { + *out_val = ""; + } + else + { + g_string_overwrite_len (&iter->buf, 0, s, (gssize)len); + *out_val = iter->buf.str; + } + return TRUE; +} + +static void +strsplit_iter_clear (StrSplitIter *iter) +{ + g_free (iter->buf.str); +} + +gboolean +g_typelib_matches_gtype_name_prefix (GITypelib *typelib, + const gchar *gtype_name) +{ + Header *header = (Header *)typelib->data; + const char *c_prefix; + gchar *prefix; + gboolean ret = FALSE; + StrSplitIter split_iter; + gsize gtype_name_len; + + c_prefix = g_typelib_get_string (typelib, header->c_prefix); + if (c_prefix == NULL || strlen (c_prefix) == 0) + return FALSE; + + gtype_name_len = strlen (gtype_name); + + /* c_prefix is a comma separated string of supported prefixes + * in the typelib. + * We match the specified gtype_name if the gtype_name starts + * with the prefix, and is followed by a capital letter. + * For example, a typelib offering the 'Gdk' prefix does match + * GdkX11Cursor, however a typelib offering the 'G' prefix does not. + */ + strsplit_iter_init (&split_iter, c_prefix, ","); + while (strsplit_iter_next (&split_iter, &prefix)) + { + size_t len = strlen (prefix); + + if (gtype_name_len < len) + continue; + + if (strncmp (prefix, gtype_name, len) != 0) + continue; + + if (g_ascii_isupper (gtype_name[len])) + { + ret = TRUE; + break; + } + } + strsplit_iter_clear (&split_iter); + return ret; +} + DirEntry * g_typelib_get_dir_entry_by_error_domain (GITypelib *typelib, GQuark error_domain) diff --git a/giscanner/annotationmain.py b/giscanner/annotationmain.py index 4df6e83..304f5a3 100644 --- a/giscanner/annotationmain.py +++ b/giscanner/annotationmain.py @@ -26,6 +26,7 @@ from giscanner.scannermain import (get_preprocessor_option_group, create_source_scanner, process_packages) + def annotation_main(args): parser = optparse.OptionParser('%prog [options] sources') diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index 9c0ce5a..a0657dc 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -26,7 +26,7 @@ import re from . import message -from .odict import odict +from .collections import OrderedDict # GTK-Doc comment block parts @@ -141,7 +141,8 @@ OPT_TRANSFER_FLOATING = 'floating' # Program matching the start of a comment block. # # Results in 0 symbolic groups. -COMMENT_START_RE = re.compile(r''' +COMMENT_START_RE = re.compile( + r''' ^ # start [^\S\n\r]* # 0 or more whitespace characters / # 1 forward slash character @@ -157,7 +158,8 @@ COMMENT_START_RE = re.compile(r''' # # Results in 1 symbolic group: # - group 1 = description -COMMENT_END_RE = re.compile(r''' +COMMENT_END_RE = re.compile( + r''' ^ # start [^\S\n\r]* # 0 or more whitespace characters (?P.*?) # description text @@ -173,7 +175,8 @@ COMMENT_END_RE = re.compile(r''' # line inside a comment block. # # Results in 0 symbolic groups. -COMMENT_ASTERISK_RE = re.compile(r''' +COMMENT_ASTERISK_RE = re.compile( + r''' ^ # start [^\S\n\r]* # 0 or more whitespace characters \* # 1 asterisk character @@ -189,7 +192,8 @@ COMMENT_ASTERISK_RE = re.compile(r''' # # Results in 1 symbolic group: # - group 1 = indentation -COMMENT_INDENTATION_RE = re.compile(r''' +COMMENT_INDENTATION_RE = re.compile( + r''' ^ (?P[^\S\n\r]*) # 0 or more whitespace characters .* @@ -200,7 +204,8 @@ COMMENT_INDENTATION_RE = re.compile(r''' # Program matching an empty line. # # Results in 0 symbolic groups. -EMPTY_LINE_RE = re.compile(r''' +EMPTY_LINE_RE = re.compile( + r''' ^ # start [^\S\n\r]* # 0 or more whitespace characters $ # end @@ -212,7 +217,8 @@ EMPTY_LINE_RE = re.compile(r''' # Results in 2 symbolic groups: # - group 1 = colon # - group 2 = section_name -SECTION_RE = re.compile(r''' +SECTION_RE = re.compile( + r''' ^ # start [^\S\n\r]* # 0 or more whitespace characters SECTION # SECTION @@ -231,7 +237,8 @@ SECTION_RE = re.compile(r''' # - group 1 = symbol_name # - group 2 = colon # - group 3 = annotations -SYMBOL_RE = re.compile(r''' +SYMBOL_RE = re.compile( + r''' ^ # start [^\S\n\r]* # 0 or more whitespace characters (?P[\w-]*\w) # symbol name @@ -251,7 +258,8 @@ SYMBOL_RE = re.compile(r''' # - group 2 = property_name # - group 3 = colon # - group 4 = annotations -PROPERTY_RE = re.compile(r''' +PROPERTY_RE = re.compile( + r''' ^ # start [^\S\n\r]* # 0 or more whitespace characters (?P[\w]+) # class name @@ -275,7 +283,8 @@ PROPERTY_RE = re.compile(r''' # - group 2 = signal_name # - group 3 = colon # - group 4 = annotations -SIGNAL_RE = re.compile(r''' +SIGNAL_RE = re.compile( + r''' ^ # start [^\S\n\r]* # 0 or more whitespace characters (?P[\w]+) # class name @@ -299,7 +308,8 @@ SIGNAL_RE = re.compile(r''' # - group 2 = annotations # - group 3 = colon # - group 4 = description -PARAMETER_RE = re.compile(r''' +PARAMETER_RE = re.compile( + r''' ^ # start [^\S\n\r]* # 0 or more whitespace characters @ # @ character @@ -324,7 +334,8 @@ PARAMETER_RE = re.compile(r''' # - group 3 = colon # - group 4 = description _all_tags = '|'.join(_ALL_TAGS).replace(' ', '\\ ') -TAG_RE = re.compile(r''' +TAG_RE = re.compile( + r''' ^ # start [^\S\n\r]* # 0 or more whitespace characters (?P''' + _all_tags + r''') # tag name @@ -348,7 +359,8 @@ TAG_RE = re.compile(r''' # - group 2 = annotations # - group 3 = colon # - group 4 = description -MULTILINE_ANNOTATION_CONTINUATION_RE = re.compile(r''' +MULTILINE_ANNOTATION_CONTINUATION_RE = re.compile( + r''' ^ # start [^\S\n\r]* # 0 or more whitespace characters (?P(?:\(.*?\)[^\S\n\r]*)*) # annotations @@ -367,9 +379,9 @@ class DocBlock(object): self.name = name self.options = DocOptions() self.value = None - self.tags = odict() + self.tags = OrderedDict() self.comment = None - self.params = odict() + self.params = OrderedDict() self.position = None def __cmp__(self, other): @@ -378,12 +390,6 @@ class DocBlock(object): def __repr__(self): return '' % (self.name, self.options) - def get_tag(self, name): - return self.tags.get(name) - - def get_param(self, name): - return self.params.get(name) - def to_gtk_doc(self): options = '' if self.options: @@ -450,8 +456,8 @@ class DocTag(object): s = 'one value' else: s = '%d values' % (n_params, ) - if ((n_params > 0 and (value is None or value.length() != n_params)) or - n_params == 0 and value is not None): + if ((n_params > 0 and (value is None or value.length() != n_params)) + or n_params == 0 and value is not None): if value is None: length = 0 else: @@ -500,7 +506,7 @@ class DocTag(object): if value is not None and value.length() > 1: message.warn( 'closure takes at most 1 value, %d given' % ( - value.length()), self.position) + value.length(), ), self.position) def _validate_element_type(self, option, value): self._validate_option(option, value, required=True) @@ -512,7 +518,7 @@ class DocTag(object): if value.length() > 2: message.warn( 'element-type takes at most 2 values, %d given' % ( - value.length()), self.position) + value.length(), ), self.position) return def _validate_out(self, option, value): @@ -521,13 +527,13 @@ class DocTag(object): if value.length() > 1: message.warn( 'out annotation takes at most 1 value, %d given' % ( - value.length()), self.position) + value.length(), ), self.position) return value_str = value.one() if value_str not in [OPT_OUT_CALLEE_ALLOCATES, OPT_OUT_CALLER_ALLOCATES]: message.warn("out annotation value is invalid: %r" % ( - value_str), self.position) + value_str, ), self.position) return def _get_gtk_doc_value(self): @@ -655,7 +661,7 @@ class DocOption(object): def __init__(self, tag, option): self.tag = tag self._array = [] - self._dict = odict() + self._dict = OrderedDict() # (annotation option1=value1 option2=value2) etc for p in option.split(' '): if '=' in p: @@ -783,7 +789,7 @@ class AnnotationParser(object): # emit a warning. if comment_block.name in comment_blocks: message.warn("multiple comment blocks documenting '%s:' identifier." % - (comment_block.name), + (comment_block.name, ), comment_block.position) comment_blocks[comment_block.name] = comment_block @@ -820,7 +826,7 @@ class AnnotationParser(object): if description: comment_lines[-1] = (line_offset, description) position = message.Position(filename, lineno + line_offset) - marker = ' '*result.end('description') + '^' + marker = ' ' * result.end('description') + '^' message.warn("Comments should end with */ on a new line:\n%s\n%s" % (line, marker), position) @@ -892,14 +898,14 @@ class AnnotationParser(object): result = SECTION_RE.match(line) if result: identifier = IDENTIFIER_SECTION - identifier_name = 'SECTION:%s' % (result.group('section_name')) + identifier_name = 'SECTION:%s' % (result.group('section_name'), ) column = result.start('section_name') + column_offset if not identifier: result = SYMBOL_RE.match(line) if result: identifier = IDENTIFIER_SYMBOL - identifier_name = '%s' % (result.group('symbol_name')) + identifier_name = '%s' % (result.group('symbol_name'), ) column = result.start('symbol_name') + column_offset if not identifier: @@ -928,7 +934,7 @@ class AnnotationParser(object): if 'colon' in result.groupdict() and result.group('colon') != ':': colon_start = result.start('colon') colon_column = column_offset + colon_start - marker = ' '*colon_column + '^' + marker = ' ' * colon_column + '^' message.warn("missing ':' at column %s:\n%s\n%s" % (colon_column + 1, original_line, marker), position) @@ -948,7 +954,7 @@ class AnnotationParser(object): # right thing to do because sooner or later some long # descriptions will contain something matching an identifier # pattern by accident. - marker = ' '*column_offset + '^' + marker = ' ' * column_offset + '^' message.warn('ignoring unrecognized GTK-Doc comment block, identifier not ' 'found:\n%s\n%s' % (original_line, marker), position) @@ -971,7 +977,7 @@ class AnnotationParser(object): if in_part != PART_PARAMETERS: column = result.start('parameter_name') + column_offset - marker = ' '*column + '^' + marker = ' ' * column + '^' message.warn("'@%s' parameter unexpected at this location:\n%s\n%s" % (param_name, original_line, marker), position) @@ -985,11 +991,11 @@ class AnnotationParser(object): returns_seen = True else: message.warn("encountered multiple 'Returns' parameters or tags for " - "'%s'." % (comment_block.name), + "'%s'." % (comment_block.name, ), position) elif param_name in comment_block.params.keys(): column = result.start('parameter_name') + column_offset - marker = ' '*column + '^' + marker = ' ' * column + '^' message.warn("multiple '@%s' parameters for identifier '%s':\n%s\n%s" % (param_name, comment_block.name, original_line, marker), position) @@ -1013,8 +1019,7 @@ class AnnotationParser(object): # identifier (when there are no parameters) and encounter an empty # line, we must be parsing the comment block description. #################################################################### - if (EMPTY_LINE_RE.match(line) - and in_part in [PART_IDENTIFIER, PART_PARAMETERS]): + if (EMPTY_LINE_RE.match(line) and in_part in [PART_IDENTIFIER, PART_PARAMETERS]): in_part = PART_DESCRIPTION part_indent = line_indent continue @@ -1028,7 +1033,7 @@ class AnnotationParser(object): tag_annotations = result.group('annotations') tag_description = result.group('description') - marker = ' '*(result.start('tag_name') + column_offset) + '^' + marker = ' ' * (result.start('tag_name') + column_offset) + '^' # Deprecated GTK-Doc Description: tag if tag_name.lower() == TAG_DESCRIPTION: @@ -1053,7 +1058,7 @@ class AnnotationParser(object): if in_part != PART_TAGS: column = result.start('tag_name') + column_offset - marker = ' '*column + '^' + marker = ' ' * column + '^' message.warn("'%s:' tag unexpected at this location:\n%s\n%s" % (tag_name, original_line, marker), position) @@ -1063,7 +1068,7 @@ class AnnotationParser(object): returns_seen = True else: message.warn("encountered multiple 'Returns' parameters or tags for " - "'%s'." % (comment_block.name), + "'%s'." % (comment_block.name, ), position) tag = DocTag(comment_block, TAG_RETURNS) @@ -1077,7 +1082,7 @@ class AnnotationParser(object): else: if tag_name.lower() in comment_block.tags.keys(): column = result.start('tag_name') + column_offset - marker = ' '*column + '^' + marker = ' ' * column + '^' message.warn("multiple '%s:' tags for identifier '%s':\n%s\n%s" % (tag_name, comment_block.name, original_line, marker), position) @@ -1090,7 +1095,7 @@ class AnnotationParser(object): tag.options = self.parse_options(tag, tag_annotations) else: message.warn("annotations not supported for tag '%s:'." % - (tag_name), + (tag_name, ), position) comment_block.tags[tag_name.lower()] = tag current_tag = tag @@ -1155,7 +1160,7 @@ class AnnotationParser(object): part.value = '' def _validate_multiline_annotation_continuation(self, line, original_line, - column_offset, position): + column_offset, position): ''' Validate parameters and tags (except the first line) and generate warnings about invalid annotations spanning multiple lines. @@ -1169,7 +1174,7 @@ class AnnotationParser(object): result = MULTILINE_ANNOTATION_CONTINUATION_RE.match(line) if result: column = result.start('annotations') + column_offset - marker = ' '*column + '^' + marker = ' ' * column + '^' message.warn('ignoring invalid multiline annotation continuation:\n' '%s\n%s' % (original_line, marker), position) @@ -1185,7 +1190,7 @@ class AnnotationParser(object): for i, c in enumerate(value): if c == '(' and opened == -1: - opened = i+1 + opened = i + 1 if c == ')' and opened != -1: segment = value[opened:i] parts = segment.split(' ', 1) diff --git a/giscanner/ast.py b/giscanner/ast.py index 5854091..4c54b54 100644 --- a/giscanner/ast.py +++ b/giscanner/ast.py @@ -24,19 +24,21 @@ from itertools import chain from . import message +from .collections import OrderedDict from .message import Position -from .odict import odict from .utils import to_underscores + class Type(object): - """A Type can be either: -* A reference to a node (target_giname) -* A reference to a "fundamental" type like 'utf8' -* A "foreign" type - this can be any string." -If none are specified, then it's in an "unresolved" state. An -unresolved type can have two data sources; a "ctype" which comes -from a C type string, or a gtype_name (from g_type_name()). -""" # ''' + """ + A Type can be either: + * A reference to a node (target_giname) + * A reference to a "fundamental" type like 'utf8' + * A "foreign" type - this can be any string." + If none are specified, then it's in an "unresolved" state. An + unresolved type can have two data sources; a "ctype" which comes + from a C type string, or a gtype_name (from g_type_name()). + """ def __init__(self, ctype=None, @@ -125,11 +127,12 @@ in contrast to the other create_type() functions.""" def __cmp__(self, other): if self.target_fundamental: return cmp(self.target_fundamental, other.target_fundamental) - if self.target_giname: + elif self.target_giname: return cmp(self.target_giname, other.target_giname) - if self.target_foreign: + elif self.target_foreign: return cmp(self.target_foreign, other.target_foreign) - return cmp(self.ctype, other.ctype) + else: + return cmp(self.ctype, other.ctype) def is_equiv(self, typeval): """Return True if the specified types are compatible at @@ -170,6 +173,7 @@ in contrast to the other create_type() functions.""" data = '' return '%s(%sctype=%s)' % (self.__class__.__name__, data, self.ctype) + class TypeUnknown(Type): def __init__(self): Type.__init__(self, _target_unknown=True) @@ -351,9 +355,7 @@ SIGNAL_MUST_COLLECT = 'must-collect' class Namespace(object): - def __init__(self, name, version, - identifier_prefixes=None, - symbol_prefixes=None): + def __init__(self, name, version, identifier_prefixes=None, symbol_prefixes=None): self.name = name self.version = version if identifier_prefixes is not None: @@ -367,15 +369,15 @@ class Namespace(object): self.symbol_prefixes = [to_underscores(p).lower() for p in ps] # cache upper-cased versions self._ucase_symbol_prefixes = [p.upper() for p in self.symbol_prefixes] - self.names = odict() # Maps from GIName -> node - self.aliases = {} # Maps from GIName -> GIName - self.type_names = {} # Maps from GTName -> node - self.ctypes = {} # Maps from CType -> node - self.symbols = {} # Maps from function symbols -> Function - self.includes = set() # Include - self.shared_libraries = [] # str - self.c_includes = [] # str - self.exported_packages = [] # str + self.names = OrderedDict() # Maps from GIName -> node + self.aliases = {} # Maps from GIName -> GIName + self.type_names = {} # Maps from GTName -> node + self.ctypes = {} # Maps from CType -> node + self.symbols = {} # Maps from function symbols -> Function + self.includes = set() # Include + self.shared_libraries = [] # str + self.c_includes = [] # str + self.exported_packages = [] # str def type_from_name(self, name, ctype=None): """Backwards compatibility method for older .gir files, which @@ -416,7 +418,7 @@ but adds it to things like ctypes, symbols, and type_names. if isinstance(node, (Class, Interface)): for m in chain(node.signals, node.properties): m.namespace = self - if isinstance(node, Enum) or isinstance(node, Bitfield): + if isinstance(node, (Enum, Bitfield)): for fn in node.static_methods: if not isinstance(fn, Function): continue @@ -482,6 +484,7 @@ functions via get_by_symbol().""" for node in self.itervalues(): node.walk(callback, []) + class Include(object): def __init__(self, name, version): @@ -504,6 +507,7 @@ class Include(object): def __str__(self): return '%s-%s' % (self.name, self.version) + class Annotated(object): """An object which has a few generic metadata properties.""" @@ -511,12 +515,13 @@ properties.""" self.version = None self.skip = False self.introspectable = True - self.attributes = [] # (key, value)* + self.attributes = [] # (key, value)* self.stability = None self.deprecated = None self.deprecated_version = None self.doc = None + class Node(Annotated): """A node is a type of object which is uniquely identified by its (namespace, name) pair. When combined with a ., this is called a @@ -527,7 +532,7 @@ GIName. It's possible for nodes to contain or point to other nodes.""" def __init__(self, name=None): Annotated.__init__(self) - self.namespace = None # Should be set later by Namespace.append() + self.namespace = None # Should be set later by Namespace.append() self.name = name self.foreign = False self.file_positions = set() @@ -596,8 +601,8 @@ class Callable(Node): self.retval = retval self.parameters = parameters self.throws = not not throws - self.instance_parameter = None # Parameter - self.parent = None # A Class or Interface + self.instance_parameter = None # Parameter + self.parent = None # A Class or Interface # Returns all parameters, including the instance parameter @property @@ -627,10 +632,10 @@ class Function(Callable): self.symbol = symbol self.is_method = False self.is_constructor = False - self.shadowed_by = None # C symbol string - self.shadows = None # C symbol string - self.moved_to = None # namespaced function name string - self.internal_skipped = False # if True, this func will not be written to GIR + self.shadowed_by = None # C symbol string + self.shadows = None # C symbol string + self.moved_to = None # namespaced function name string + self.internal_skipped = False # if True, this func will not be written to GIR def clone(self): clone = copy.copy(self) @@ -641,8 +646,7 @@ class Function(Callable): def is_type_meta_function(self): # Named correctly - if not (self.name.endswith('_get_type') or - self.name.endswith('_get_gtype')): + if not (self.name.endswith('_get_type') or self.name.endswith('_get_gtype')): return False # Doesn't have any parameters @@ -651,14 +655,13 @@ class Function(Callable): # Returns GType rettype = self.retval.type - if (not rettype.is_equiv(TYPE_GTYPE) and - rettype.target_giname != 'Gtk.Type'): - message.warn("function '%s' returns '%r', not a GType" % - (self.name, rettype)) + if (not rettype.is_equiv(TYPE_GTYPE) and rettype.target_giname != 'Gtk.Type'): + message.warn("function '%s' returns '%r', not a GType" % (self.name, rettype)) return False return True + class ErrorQuarkFunction(Function): def __init__(self, name, retval, parameters, throws, symbol, error_domain): @@ -679,7 +682,6 @@ class VFunction(Callable): return obj - class Varargs(Type): def __init__(self): @@ -715,6 +717,7 @@ class Array(Type): arr.size = self.size return arr + class List(Type): def __init__(self, name, element_type, **kwargs): @@ -727,6 +730,7 @@ class List(Type): def clone(self): return List(self.name, self.element_type) + class Map(Type): def __init__(self, key_type, value_type, **kwargs): @@ -739,6 +743,7 @@ class Map(Type): def clone(self): return Map(self.key_type, self.value_type) + class Alias(Node): def __init__(self, name, target, ctype=None): @@ -881,6 +886,7 @@ class Compound(Node, Registered): if field.anonymous_node is not None: field.anonymous_node.walk(callback, chain) + class Field(Annotated): def __init__(self, name, typenode, readable, writable, bits=None, @@ -894,7 +900,7 @@ class Field(Annotated): self.bits = bits self.anonymous_node = anonymous_node self.private = False - self.parent = None # a compound + self.parent = None # a compound def __cmp__(self, other): return cmp(self.name, other.name) @@ -1090,7 +1096,7 @@ class Property(Node): self.transfer = PARAM_TRANSFER_NONE else: self.transfer = transfer - self.parent = None # A Class or Interface + self.parent = None # A Class or Interface class Callback(Callable): diff --git a/giscanner/cachestore.py b/giscanner/cachestore.py index 44e3b04..ad4c7a3 100644 --- a/giscanner/cachestore.py +++ b/giscanner/cachestore.py @@ -31,6 +31,7 @@ import giscanner _CACHE_VERSION_FILENAME = '.cache-version' + def _get_versionhash(): toplevel = os.path.dirname(giscanner.__file__) # Use pyc instead of py to avoid extra IO @@ -40,6 +41,7 @@ def _get_versionhash(): mtimes = (str(os.stat(source).st_mtime) for source in sources) return hashlib.sha1(''.join(mtimes)).hexdigest() + def _get_cachedir(): if 'GI_SCANNER_DISABLE_CACHE' in os.environ: return None @@ -73,7 +75,7 @@ class CacheStore(object): def __init__(self): try: self._directory = _get_cachedir() - except OSError, e: + except OSError as e: if e.errno != errno.EPERM: raise self._directory = None @@ -88,7 +90,7 @@ class CacheStore(object): version = os.path.join(self._directory, _CACHE_VERSION_FILENAME) try: cache_hash = open(version).read() - except IOError, e: + except IOError as e: # File does not exist if e.errno == errno.ENOENT: cache_hash = 0 @@ -101,7 +103,7 @@ class CacheStore(object): self._clean() try: fp = open(version, 'w') - except IOError, e: + except IOError as e: # Permission denied if e.errno == errno.EACCES: return @@ -126,13 +128,13 @@ class CacheStore(object): def _remove_filename(self, filename): try: os.unlink(filename) - except IOError, e: + except IOError as e: # Permission denied if e.errno == errno.EACCES: return else: raise - except OSError, e: + except OSError as e: # File does not exist if e.errno == errno.ENOENT: return @@ -150,14 +152,13 @@ class CacheStore(object): if store_filename is None: return - if (os.path.exists(store_filename) and - self._cache_is_valid(store_filename, filename)): + if (os.path.exists(store_filename) and self._cache_is_valid(store_filename, filename)): return None tmp_fd, tmp_filename = tempfile.mkstemp(prefix='g-ir-scanner-cache-') try: cPickle.dump(data, os.fdopen(tmp_fd, 'w')) - except IOError, e: + except IOError as e: # No space left on device if e.errno == errno.ENOSPC: self._remove_filename(tmp_filename) @@ -167,7 +168,7 @@ class CacheStore(object): try: shutil.move(tmp_filename, store_filename) - except IOError, e: + except IOError as e: # Permission denied if e.errno == errno.EACCES: self._remove_filename(tmp_filename) @@ -180,7 +181,7 @@ class CacheStore(object): return try: fd = open(store_filename) - except IOError, e: + except IOError as e: if e.errno == errno.ENOENT: return None else: diff --git a/giscanner/codegen.py b/giscanner/codegen.py index b73a7da..e9ed941 100644 --- a/giscanner/codegen.py +++ b/giscanner/codegen.py @@ -24,6 +24,7 @@ from contextlib import contextmanager from . import ast + class CCodeGenerator(object): def __init__(self, namespace, out_h_filename, out_c_filename): self.out_h_filename = out_h_filename @@ -36,15 +37,16 @@ class CCodeGenerator(object): return '%s_%s' % (self.namespace.symbol_prefixes[0], name) def _typecontainer_to_ctype(self, param): - if (isinstance(param, ast.Parameter) and - param.direction in (ast.PARAM_DIRECTION_OUT, - ast.PARAM_DIRECTION_INOUT)): + if (isinstance(param, ast.Parameter) + and param.direction in (ast.PARAM_DIRECTION_OUT, ast.PARAM_DIRECTION_INOUT)): suffix = '*' else: suffix = '' - if (param.type.is_equiv((ast.TYPE_STRING, ast.TYPE_FILENAME)) and - param.transfer == ast.PARAM_TRANSFER_NONE): + + if (param.type.is_equiv((ast.TYPE_STRING, ast.TYPE_FILENAME)) + and param.transfer == ast.PARAM_TRANSFER_NONE): return "const gchar*" + suffix + return param.type.ctype + suffix def _write_prelude(self, out, func): diff --git a/giscanner/collections/__init__.py b/giscanner/collections/__init__.py new file mode 100644 index 0000000..29987a1 --- /dev/null +++ b/giscanner/collections/__init__.py @@ -0,0 +1,22 @@ +# -*- Mode: Python -*- +# GObject-Introspection - a framework for introspecting GObject libraries +# Copyright (C) 2013 Dieter Verfaillie +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. +# + + +from .ordereddict import OrderedDict diff --git a/giscanner/collections/ordereddict.py b/giscanner/collections/ordereddict.py new file mode 100644 index 0000000..0cb4b95 --- /dev/null +++ b/giscanner/collections/ordereddict.py @@ -0,0 +1,120 @@ +# -*- Mode: Python -*- +# GObject-Introspection - a framework for introspecting GObject libraries +# Copyright (C) 2008 Johan Dahlin +# Copyright (C) 2013 Dieter Verfaillie +# +# 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 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. + + +# Borrowed from: +# http://hg.sqlalchemy.org/sqlalchemy/raw-file/77e2264283d4/lib/sqlalchemy/util/_collections.py +# http://hg.sqlalchemy.org/sqlalchemy/raw-file/77e2264283d4/AUTHORS +# +# util/_collections.py +# Copyright (C) 2005-2012 the SQLAlchemy authors and contributors +# +# This module is part of SQLAlchemy and is released under +# the MIT License: http://www.opensource.org/licenses/mit-license.php + + +class OrderedDict(dict): + """A dict that returns keys/values/items in the order they were added.""" + + def __init__(self, ____sequence=None, **kwargs): + self._list = [] + if ____sequence is None: + if kwargs: + self.update(**kwargs) + else: + self.update(____sequence, **kwargs) + + def clear(self): + self._list = [] + dict.clear(self) + + def copy(self): + return self.__copy__() + + def __copy__(self): + return OrderedDict(self) + + def sort(self, *arg, **kw): + self._list.sort(*arg, **kw) + + def update(self, ____sequence=None, **kwargs): + if ____sequence is not None: + if hasattr(____sequence, 'keys'): + for key in ____sequence.keys(): + self.__setitem__(key, ____sequence[key]) + else: + for key, value in ____sequence: + self[key] = value + if kwargs: + self.update(kwargs) + + def setdefault(self, key, value): + if key not in self: + self.__setitem__(key, value) + return value + else: + return self.__getitem__(key) + + def __iter__(self): + return iter(self._list) + + def values(self): + return [self[key] for key in self._list] + + def itervalues(self): + return iter([self[key] for key in self._list]) + + def keys(self): + return list(self._list) + + def iterkeys(self): + return iter(self.keys()) + + def items(self): + return [(key, self[key]) for key in self.keys()] + + def iteritems(self): + return iter(self.items()) + + def __setitem__(self, key, obj): + if key not in self: + try: + self._list.append(key) + except AttributeError: + # work around Python pickle loads() with + # dict subclass (seems to ignore __setstate__?) + self._list = [key] + dict.__setitem__(self, key, obj) + + def __delitem__(self, key): + dict.__delitem__(self, key) + self._list.remove(key) + + def pop(self, key, *default): + present = key in self + value = dict.pop(self, key, *default) + if present: + self._list.remove(key) + return value + + def popitem(self): + item = dict.popitem(self) + self._list.remove(item[0]) + return item diff --git a/giscanner/docmain.py b/giscanner/docmain.py index afd509f..3287dcc 100644 --- a/giscanner/docmain.py +++ b/giscanner/docmain.py @@ -24,6 +24,7 @@ import optparse from .docwriter import DocWriter from .transformer import Transformer + def doc_main(args): parser = optparse.OptionParser('%prog [options] GIR-file') diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py index 7924b2d..982ab37 100644 --- a/giscanner/docwriter.py +++ b/giscanner/docwriter.py @@ -31,6 +31,7 @@ from mako.lookup import TemplateLookup from . import ast, xmlwriter from .utils import to_underscores + def make_page_id(node, recursive=False): if isinstance(node, ast.Namespace): if recursive: @@ -51,6 +52,7 @@ def make_page_id(node, recursive=False): else: return '%s.%s' % (make_page_id(parent, recursive=True), node.name) + def get_node_kind(node): if isinstance(node, ast.Namespace): node_kind = 'namespace' @@ -78,6 +80,7 @@ def get_node_kind(node): return node_kind + class TemplatedScanner(object): def __init__(self, specs): self.specs = self.unmangle_specs(specs) @@ -141,6 +144,7 @@ class TemplatedScanner(object): if pos < len(text): yield ('other', text[pos:], None) + class DocstringScanner(TemplatedScanner): def __init__(self): specs = [ @@ -156,6 +160,7 @@ class DocstringScanner(TemplatedScanner): super(DocstringScanner, self).__init__(specs) + class DocFormatter(object): def __init__(self, transformer): self._transformer = transformer @@ -219,7 +224,7 @@ class DocFormatter(object): try: prop = self._find_thing(type_node.properties, props['property_name']) - except (AttributeError, KeyError), e: + except (AttributeError, KeyError): return match return self.format_xref(prop) @@ -231,7 +236,7 @@ class DocFormatter(object): try: signal = self._find_thing(type_node.signals, props['signal_name']) - except (AttributeError, KeyError), e: + except (AttributeError, KeyError): return match return self.format_xref(signal) @@ -260,7 +265,7 @@ class DocFormatter(object): def _process_parameter(self, node, match, props): try: parameter = node.get_parameter(props['param_name']) - except (AttributeError, ValueError), e: + except (AttributeError, ValueError): return match return '%s' % (self.format_parameter_name(node, parameter), ) @@ -358,6 +363,7 @@ class DocFormatter(object): parent_chain.reverse() return parent_chain + class DocFormatterC(DocFormatter): language = "C" mime_type = "text/x-csrc" @@ -380,7 +386,7 @@ class DocFormatterC(DocFormatter): return getattr(node, 'ctype') def format_function_name(self, func): - if isinstance(func, (ast.Function)): + if isinstance(func, ast.Function): return func.symbol else: return func.name @@ -388,6 +394,7 @@ class DocFormatterC(DocFormatter): def get_parameters(self, node): return node.all_parameters + class DocFormatterIntrospectableBase(DocFormatter): def should_render_node(self, node): if isinstance(node, ast.Record) and node.is_gtype_struct_for is not None: @@ -398,6 +405,7 @@ class DocFormatterIntrospectableBase(DocFormatter): return super(DocFormatterIntrospectableBase, self).should_render_node(node) + class DocFormatterPython(DocFormatterIntrospectableBase): language = "Python" mime_type = "text/python" @@ -418,7 +426,7 @@ class DocFormatterPython(DocFormatterIntrospectableBase): if getattr(node, "is_method", False): return True - if isinstance(node, (ast.VFunction)): + if isinstance(node, ast.VFunction): return True return False @@ -451,8 +459,7 @@ class DocFormatterPython(DocFormatterIntrospectableBase): "GParam": "GLib.Param", "PyObject": "object", "GStrv": "[str]", - "GVariant": "GLib.Variant", - } + "GVariant": "GLib.Variant"} return fundamental_types.get(name, name) @@ -476,6 +483,7 @@ class DocFormatterPython(DocFormatterIntrospectableBase): def get_parameters(self, node): return node.all_parameters + class DocFormatterGjs(DocFormatterIntrospectableBase): language = "Gjs" mime_type = "text/x-gjs" @@ -490,7 +498,7 @@ class DocFormatterGjs(DocFormatterIntrospectableBase): if getattr(node, "is_method", False): return True - if isinstance(node, (ast.VFunction)): + if isinstance(node, ast.VFunction): return True return False @@ -514,8 +522,7 @@ class DocFormatterGjs(DocFormatterIntrospectableBase): "GParam": "GLib.Param", "PyObject": "Object", "GStrv": "[String]", - "GVariant": "GLib.Variant", - } + "GVariant": "GLib.Variant"} return fundamental_types.get(name, name) @@ -558,12 +565,14 @@ class DocFormatterGjs(DocFormatterIntrospectableBase): params.append(param) return params + LANGUAGES = { "c": DocFormatterC, "python": DocFormatterPython, "gjs": DocFormatterGjs, } + class DocWriter(object): def __init__(self, transformer, language): self._transformer = transformer diff --git a/giscanner/dumper.py b/giscanner/dumper.py index d95ea6b..157b24d 100644 --- a/giscanner/dumper.py +++ b/giscanner/dumper.py @@ -89,8 +89,9 @@ class DumpCompiler(object): # Enable the --msvc-syntax pkg-config flag when # the Microsoft compiler is used # (This is the other way to check whether Visual C++ is used subsequently) - if 'cl' in self._compiler_cmd: - self._pkgconfig_msvc_flags = '--msvc-syntax' + if 'clang' not in self._compiler_cmd: + if 'cl' in self._compiler_cmd: + self._pkgconfig_msvc_flags = '--msvc-syntax' self._uninst_srcdir = os.environ.get( 'UNINSTALLED_INTROSPECTION_SRCDIR') self._packages = ['gio-2.0 gmodule-2.0'] @@ -166,14 +167,14 @@ class DumpCompiler(object): try: self._compile(o_path, c_path) - except CompilerError, e: + except CompilerError as e: if not utils.have_debug_flag('save-temps'): shutil.rmtree(tmpdir) raise SystemExit('compilation of temporary binary failed:' + str(e)) try: self._link(bin_path, o_path) - except LinkerError, e: + except LinkerError as e: if not utils.have_debug_flag('save-temps'): shutil.rmtree(tmpdir) raise SystemExit('linking of temporary binary failed: ' + str(e)) @@ -222,7 +223,7 @@ class DumpCompiler(object): # The Microsoft compiler uses different option flags for # compilation result output if self._pkgconfig_msvc_flags: - args.extend(['-c', '-Fe'+output, '-Fo'+output]) + args.extend(['-c', '-Fe' + output, '-Fo' + output]) else: args.extend(['-c', '-o', output]) for source in sources: @@ -236,7 +237,7 @@ class DumpCompiler(object): sys.stdout.flush() try: subprocess.check_call(args) - except subprocess.CalledProcessError, e: + except subprocess.CalledProcessError as e: raise CompilerError(e) def _link(self, output, *sources): @@ -253,7 +254,7 @@ class DumpCompiler(object): # We can use -o for the Microsoft compiler/linker, # but it is considered deprecated usage with that if self._pkgconfig_msvc_flags: - args.extend(['-Fe'+output]) + args.extend(['-Fe' + output]) else: args.extend(['-o', output]) if libtool: @@ -290,7 +291,7 @@ class DumpCompiler(object): sys.stdout.flush() try: subprocess.check_call(args) - except subprocess.CalledProcessError, e: + except subprocess.CalledProcessError as e: raise LinkerError(e) def _add_link_internal_args(self, args, libtool): @@ -312,18 +313,23 @@ class DumpCompiler(object): if self._options.namespace_version: args.append(str.lower(self._options.namespace_name) + '-' + - self._options.namespace_version+'.lib') + self._options.namespace_version + '.lib') else: - args.append(str.lower(self._options.namespace_name)+'.lib') + args.append(str.lower(self._options.namespace_name) + '.lib') else: args.append('-Wl,-rpath=.') + # Ensure libraries are always linked as we are going to use ldd to work + # out their names later + if not libtool and self._pkgconfig_msvc_flags == '': + args.append('-Wl,--no-as-needed') + for library in self._options.libraries: # Visual C++: We have the needed .lib files now, and we need to link # to .lib files, not the .dll as the --library option specifies the # .dll(s) the .gir file refers to if self._pkgconfig_msvc_flags == '': - if library.endswith(".la"): # explicitly specified libtool library + if library.endswith(".la"): # explicitly specified libtool library args.append(library) else: args.append('-l' + library) @@ -352,11 +358,12 @@ class DumpCompiler(object): # The --library option on Windows pass in the .dll file(s) the # .gir files refer to, so don't link to them on Visual C++ if self._pkgconfig_msvc_flags == '': - if library.endswith(".la"): # explicitly specified libtool library + if library.endswith(".la"): # explicitly specified libtool library args.append(library) else: args.append('-l' + library) + def compile_introspection_binary(options, get_type_functions, error_quark_functions): dc = DumpCompiler(options, get_type_functions, error_quark_functions) diff --git a/giscanner/gdumpparser.py b/giscanner/gdumpparser.py index c0b13f4..568777b 100644 --- a/giscanner/gdumpparser.py +++ b/giscanner/gdumpparser.py @@ -165,7 +165,7 @@ blob containing data gleaned from GObject's primitive introspection.""" try: try: subprocess.check_call(args, stdout=sys.stdout, stderr=sys.stderr) - except subprocess.CalledProcessError, e: + except subprocess.CalledProcessError as e: # Clean up temporaries raise SystemExit(e) return parse(out_path) @@ -203,8 +203,7 @@ blob containing data gleaned from GObject's primitive introspection.""" def _initparse_gobject_record(self, record): if (record.name.startswith('ParamSpec') - and not record.name in ('ParamSpecPool', 'ParamSpecClass', - 'ParamSpecTypeInfo')): + and not record.name in ('ParamSpecPool', 'ParamSpecClass', 'ParamSpecTypeInfo')): parent = None if record.name != 'ParamSpec': parent = ast.Type(target_giname='GObject.ParamSpec') @@ -251,7 +250,7 @@ blob containing data gleaned from GObject's primitive introspection.""" (get_type, c_symbol_prefix) = self._split_type_and_symbol_prefix(xmlnode) try: enum_name = self._transformer.strip_identifier(type_name) - except TransformerException, e: + except TransformerException as e: message.fatal(e) # The scanned member values are more accurate than the values that the @@ -280,7 +279,6 @@ blob containing data gleaned from GObject's primitive introspection.""" member.attrib['name'], member.attrib['nick'])) - if xmlnode.tag == 'flags': klass = ast.Bitfield else: @@ -316,7 +314,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide (get_type, c_symbol_prefix) = self._split_type_and_symbol_prefix(xmlnode) try: object_name = self._transformer.strip_identifier(type_name) - except TransformerException, e: + except TransformerException as e: message.fatal(e) node = ast.Class(object_name, None, gtype_name=type_name, @@ -346,7 +344,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide (get_type, c_symbol_prefix) = self._split_type_and_symbol_prefix(xmlnode) try: interface_name = self._transformer.strip_identifier(type_name) - except TransformerException, e: + except TransformerException as e: message.fatal(e) node = ast.Interface(interface_name, None, gtype_name=type_name, @@ -391,7 +389,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide try: name = self._transformer.strip_identifier(type_name) - except TransformerException, e: + except TransformerException as e: message.fatal(e) # This one doesn't go in the main namespace; we associate it with # the struct or union @@ -437,7 +435,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide if i == 0: argname = 'object' else: - argname = 'p%s' % (i-1, ) + argname = 'p%s' % (i - 1, ) pctype = parameter.attrib['type'] ptype = ast.Type.create_from_gtype_name(pctype) param = ast.Parameter(argname, ptype) @@ -465,7 +463,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide (get_type, c_symbol_prefix) = self._split_type_and_symbol_prefix(xmlnode) try: fundamental_name = self._transformer.strip_identifier(type_name) - except TransformerException, e: + except TransformerException as e: message.warn(e) return @@ -509,7 +507,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide def _pair_boxed_type(self, boxed): try: name = self._transformer.strip_identifier(boxed.gtype_name) - except TransformerException, e: + except TransformerException as e: message.fatal(e) pair_node = self._namespace.get(name) if not pair_node: @@ -526,8 +524,7 @@ different --identifier-prefix.""" % (xmlnode.attrib['name'], self._namespace.ide return False def _strip_class_suffix(self, name): - if (name.endswith('Class') or - name.endswith('Iface')): + if (name.endswith('Class') or name.endswith('Iface')): return name[:-5] elif name.endswith('Interface'): return name[:-9] diff --git a/giscanner/girparser.py b/giscanner/girparser.py index 63a3fd0..2538036 100644 --- a/giscanner/girparser.py +++ b/giscanner/girparser.py @@ -101,9 +101,8 @@ class GIRParser(object): assert root.tag == _corens('repository') version = root.attrib['version'] if version != COMPATIBLE_GIR_VERSION: - raise SystemExit("%s: Incompatible version %s (supported: %s)" \ - % (self._get_current_file(), - version, COMPATIBLE_GIR_VERSION)) + raise SystemExit("%s: Incompatible version %s (supported: %s)" % + (self._get_current_file(), version, COMPATIBLE_GIR_VERSION)) for node in root.getchildren(): if node.tag == _corens('include'): @@ -122,9 +121,9 @@ class GIRParser(object): if symbol_prefixes: symbol_prefixes = symbol_prefixes.split(',') self._namespace = ast.Namespace(ns.attrib['name'], - ns.attrib['version'], - identifier_prefixes=identifier_prefixes, - symbol_prefixes=symbol_prefixes) + ns.attrib['version'], + identifier_prefixes=identifier_prefixes, + symbol_prefixes=symbol_prefixes) if 'shared-library' in ns.attrib: self._namespace.shared_libraries = ns.attrib['shared-library'].split(',') self._namespace.includes = self._includes @@ -140,8 +139,7 @@ class GIRParser(object): _corens('interface'): self._parse_object_interface, _corens('record'): self._parse_record, _corens('union'): self._parse_union, - _glibns('boxed'): self._parse_boxed, - } + _glibns('boxed'): self._parse_boxed} if not self._types_only: parser_methods[_corens('constant')] = self._parse_constant @@ -153,8 +151,7 @@ class GIRParser(object): method(node) def _parse_include(self, node): - include = ast.Include(node.attrib['name'], - node.attrib['version']) + include = ast.Include(node.attrib['name'], node.attrib['version']) self._includes.add(include) def _parse_pkgconfig_package(self, node): @@ -165,9 +162,7 @@ class GIRParser(object): def _parse_alias(self, node): typeval = self._parse_type(node) - alias = ast.Alias(node.attrib['name'], - typeval, - node.attrib.get(_cns('type'))) + alias = ast.Alias(node.attrib['name'], typeval, node.attrib.get(_cns('type'))) self._parse_generic_attribs(node, alias) self._namespace.append(alias) @@ -427,7 +422,8 @@ class GIRParser(object): return ast.Type(ctype=ctype) elif name in ['GLib.List', 'GLib.SList']: subchild = self._find_first_child(typenode, - map(_corens, ('callback', 'array', 'varargs', 'type'))) + map(_corens, ('callback', 'array', + 'varargs', 'type'))) if subchild is not None: element_type = self._parse_type(typenode) else: @@ -438,9 +434,7 @@ class GIRParser(object): subchildren_types = map(self._parse_type_simple, subchildren) while len(subchildren_types) < 2: subchildren_types.append(ast.TYPE_ANY) - return ast.Map(subchildren_types[0], - subchildren_types[1], - ctype=ctype) + return ast.Map(subchildren_types[0], subchildren_types[1], ctype=ctype) else: return self._namespace.type_from_name(name, ctype) else: @@ -462,8 +456,8 @@ class GIRParser(object): lenidx = typenode.attrib.get('length') if lenidx is not None: idx = int(lenidx) - assert idx < len(parent.parameters), "%r %d >= %d" \ - % (parent, idx, len(parent.parameters)) + assert idx < len(parent.parameters), "%r %d >= %d" % (parent, idx, + len(parent.parameters)) typeval.length_param_name = parent.parameters[idx].argname def _parse_boxed(self, node): @@ -509,11 +503,11 @@ class GIRParser(object): assert node.tag == _corens('field'), node.tag type_node = self._parse_type(node) field = ast.Field(node.attrib.get('name'), - type_node, - node.attrib.get('readable') != '0', - node.attrib.get('writable') == '1', - node.attrib.get('bits'), - anonymous_node=anonymous_node) + type_node, + node.attrib.get('readable') != '0', + node.attrib.get('writable') == '1', + node.attrib.get('bits'), + anonymous_node=anonymous_node) field.private = node.attrib.get('private') == '1' field.parent = parent self._parse_generic_attribs(node, field) @@ -521,12 +515,12 @@ class GIRParser(object): def _parse_property(self, node, parent): prop = ast.Property(node.attrib['name'], - self._parse_type(node), - node.attrib.get('readable') != '0', - node.attrib.get('writable') == '1', - node.attrib.get('construct') == '1', - node.attrib.get('construct-only') == '1', - node.attrib.get('transfer-ownership')) + self._parse_type(node), + node.attrib.get('readable') != '0', + node.attrib.get('writable') == '1', + node.attrib.get('construct') == '1', + node.attrib.get('construct-only') == '1', + node.attrib.get('transfer-ownership')) self._parse_generic_attribs(node, prop) prop.parent = parent return prop diff --git a/giscanner/girwriter.py b/giscanner/girwriter.py index d6b3485..e7af253 100644 --- a/giscanner/girwriter.py +++ b/giscanner/girwriter.py @@ -28,14 +28,15 @@ from .xmlwriter import XMLWriter # Compatible changes we just make inline COMPATIBLE_GIR_VERSION = '1.2' + class GIRWriter(XMLWriter): def __init__(self, namespace): super(GIRWriter, self).__init__() self.write_comment( -'''This file was automatically generated from C sources - DO NOT EDIT! -To affect the contents of this file, edit the original C definitions, -and/or use gtk-doc annotations. ''') + 'This file was automatically generated from C sources - DO NOT EDIT!\n' + 'To affect the contents of this file, edit the original C definitions,\n' + 'and/or use gtk-doc annotations. ') self._write_repository(namespace) def _write_repository(self, namespace): @@ -43,8 +44,7 @@ and/or use gtk-doc annotations. ''') ('version', COMPATIBLE_GIR_VERSION), ('xmlns', 'http://www.gtk.org/introspection/core/1.0'), ('xmlns:c', 'http://www.gtk.org/introspection/c/1.0'), - ('xmlns:glib', 'http://www.gtk.org/introspection/glib/1.0'), - ] + ('xmlns:glib', 'http://www.gtk.org/introspection/glib/1.0')] with self.tagcontext('repository', attrs): for include in sorted(namespace.includes): self._write_include(include) @@ -126,7 +126,7 @@ and/or use gtk-doc annotations. ''') for key, value in node.attributes: self.write_tag('attribute', [('name', key), ('value', value)]) if hasattr(node, 'doc') and node.doc: - self.write_tag('doc', [('xml:whitespace', 'preserve')], + self.write_tag('doc', [('xml:space', 'preserve')], node.doc) def _append_node_generic(self, node, attrs): @@ -292,8 +292,8 @@ and/or use gtk-doc annotations. ''') attrs.append(('fixed-size', '%d' % (ntype.size, ))) if ntype.length_param_name is not None: assert function - attrs.insert(0, ('length', '%d' - % (function.get_parameter_index(ntype.length_param_name, )))) + length = function.get_parameter_index(ntype.length_param_name) + attrs.insert(0, ('length', '%d' % (length, ))) with self.tagcontext('array', attrs): self._write_type(ntype.element_type) @@ -482,7 +482,7 @@ and/or use gtk-doc annotations. ''') attrs = list(extra_attrs) if record.name is not None: attrs.append(('name', record.name)) - if record.ctype is not None: # the record might be anonymous + if record.ctype is not None: # the record might be anonymous attrs.append(('c:type', record.ctype)) if record.disguised: attrs.append(('disguised', '1')) @@ -513,7 +513,7 @@ and/or use gtk-doc annotations. ''') attrs = [] if union.name is not None: attrs.append(('name', union.name)) - if union.ctype is not None: # the union might be anonymous + if union.ctype is not None: # the union might be anonymous attrs.append(('c:type', union.ctype)) self._append_version(union, attrs) self._append_node_generic(union, attrs) @@ -544,8 +544,7 @@ and/or use gtk-doc annotations. ''') elif isinstance(field.anonymous_node, ast.Union): self._write_union(field.anonymous_node) else: - raise AssertionError("Unknown field anonymous: %r" \ - % (field.anonymous_node, )) + raise AssertionError("Unknown field anonymous: %r" % (field.anonymous_node, )) else: attrs = [('name', field.name)] self._append_node_generic(field, attrs) diff --git a/giscanner/giscannermodule.c b/giscanner/giscannermodule.c index 0ece7f7..a5686ea 100644 --- a/giscanner/giscannermodule.c +++ b/giscanner/giscannermodule.c @@ -695,7 +695,7 @@ pygi_collect_attributes (PyObject *self, goto out; } - if (!PyTuple_Size (tuple) == 2) + if (PyTuple_Size (tuple) != 2) { PyErr_SetString(PyExc_IndexError, "attribute item must be a tuple of length 2"); diff --git a/giscanner/introspectablepass.py b/giscanner/introspectablepass.py index 460c820..3d67c73 100644 --- a/giscanner/introspectablepass.py +++ b/giscanner/introspectablepass.py @@ -21,6 +21,7 @@ from . import ast from . import message from .annotationparser import TAG_RETURNS + class IntrospectablePass(object): def __init__(self, transformer, blocks): @@ -58,7 +59,7 @@ class IntrospectablePass(object): else: context = "return value: " if block: - return_tag = block.get_tag(TAG_RETURNS) + return_tag = block.tags.get(TAG_RETURNS) if return_tag: position = return_tag.position message.warn_node(parent, prefix + context + text, @@ -79,7 +80,7 @@ class IntrospectablePass(object): if not node.type.resolved: self._parameter_warning(parent, node, -"Unresolved type: %r" % (node.type.unresolved_string, )) + "Unresolved type: %r" % (node.type.unresolved_string, )) parent.introspectable = False return @@ -88,22 +89,23 @@ class IntrospectablePass(object): return if (isinstance(node.type, (ast.List, ast.Array)) - and node.type.element_type == ast.TYPE_ANY): + and node.type.element_type == ast.TYPE_ANY): self._parameter_warning(parent, node, "Missing (element-type) annotation") parent.introspectable = False return if (is_parameter - and isinstance(target, ast.Callback) - and not node.type.target_giname in ('GLib.DestroyNotify', - 'Gio.AsyncReadyCallback') - and node.scope is None): - self._parameter_warning(parent, node, - ("Missing (scope) annotation for callback" + - " without GDestroyNotify (valid: %s, %s)") - % (ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC)) - parent.introspectable = False - return + and isinstance(target, ast.Callback) + and not node.type.target_giname in ('GLib.DestroyNotify', 'Gio.AsyncReadyCallback') + and node.scope is None): + self._parameter_warning( + parent, + node, + "Missing (scope) annotation for callback without " + "GDestroyNotify (valid: %s, %s)" % (ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC)) + + parent.introspectable = False + return if is_return and isinstance(target, ast.Callback): self._parameter_warning(parent, node, "Callbacks cannot be return values; use (skip)") @@ -111,12 +113,14 @@ class IntrospectablePass(object): return if (is_return - and isinstance(target, (ast.Record, ast.Union)) - and target.get_type is None - and not target.foreign): + and isinstance(target, (ast.Record, ast.Union)) + and target.get_type is None + and not target.foreign): if node.transfer != ast.PARAM_TRANSFER_NONE: - self._parameter_warning(parent, node, -"Invalid non-constant return of bare structure or union; register as boxed type or (skip)") + self._parameter_warning( + parent, node, + "Invalid non-constant return of bare structure or union; " + "register as boxed type or (skip)") parent.introspectable = False return @@ -143,10 +147,10 @@ class IntrospectablePass(object): # These are not introspectable pending us adding # larger type tags to the typelib (in theory these could # be 128 bit or larger) - if typeval.is_equiv((ast.TYPE_LONG_LONG, ast.TYPE_LONG_ULONG, - ast.TYPE_LONG_DOUBLE)): + elif typeval.is_equiv((ast.TYPE_LONG_LONG, ast.TYPE_LONG_ULONG, ast.TYPE_LONG_DOUBLE)): return False - return True + else: + return True target = self._transformer.lookup_typenode(typeval) if not target: return False diff --git a/giscanner/libtoolimporter.py b/giscanner/libtoolimporter.py index 20bd005..0d26b0c 100644 --- a/giscanner/libtoolimporter.py +++ b/giscanner/libtoolimporter.py @@ -72,5 +72,5 @@ class LibtoolImporter(object): sys.meta_path.append(cls) @classmethod - def __exit__(cls, type, value, traceback): + def __exit__(cls, exc_type, exc_val, exc_tb): sys.meta_path.remove(cls) diff --git a/giscanner/maintransformer.py b/giscanner/maintransformer.py index 049ba9b..11bfb4c 100644 --- a/giscanner/maintransformer.py +++ b/giscanner/maintransformer.py @@ -35,9 +35,8 @@ from .annotationparser import (OPT_ALLOW_NONE, OPT_ARRAY, OPT_ATTRIBUTE, OPT_ARRAY_LENGTH, OPT_ARRAY_ZERO_TERMINATED, OPT_CONSTRUCTOR, OPT_METHOD, OPT_TRANSFER_NONE, OPT_TRANSFER_FLOATING) -from .annotationparser import AnnotationParser -from .transformer import TransformerException -from .utils import to_underscores, to_underscores_noprefix +from .utils import to_underscores_noprefix + class MainTransformer(object): @@ -50,12 +49,10 @@ class MainTransformer(object): # Public API def transform(self): - contents = list(self._namespace.itervalues()) - if len(contents) == 0: - message.fatal("""Namespace is empty; likely causes are: -* Not including .h files to be scanned -* Broken --identifier-prefix -""") + if not self._namespace.names: + message.fatal('Namespace is empty; likely causes are:\n' + '* Not including .h files to be scanned\n' + '* Broken --identifier-prefix') # Some initial namespace surgery self._namespace.walk(self._pass_fixup_hidden_fields) @@ -109,17 +106,14 @@ class MainTransformer(object): def _pass_fixup_hidden_fields(self, node, chain): """Hide all callbacks starting with _; the typical -usage is void (*_gtk_reserved1)(void);""" - if not isinstance(node, (ast.Class, ast.Interface, - ast.Record, ast.Union)): - return True - for field in node.fields: - if field is None: - continue - if (field.name.startswith('_') + usage is void (*_gtk_reserved1)(void);""" + if isinstance(node, (ast.Class, ast.Interface, ast.Record, ast.Union)): + for field in node.fields: + if (field + and field.name.startswith('_') and field.anonymous_node is not None and isinstance(field.anonymous_node, ast.Callback)): - field.introspectable = False + field.introspectable = False return True def _get_validate_parameter_name(self, parent, param_name, origin): @@ -142,7 +136,7 @@ usage is void (*_gtk_reserved1)(void);""" def _apply_annotation_rename_to(self, node, chain, block): if not block: return - rename_to = block.get_tag(TAG_RENAME_TO) + rename_to = block.tags.get(TAG_RENAME_TO) if not rename_to: return rename_to = rename_to.value @@ -211,7 +205,7 @@ usage is void (*_gtk_reserved1)(void);""" if isinstance(node, ast.Function): self._apply_annotations_function(node, chain) if isinstance(node, ast.Callback): - self._apply_annotations_callable(node, chain, block = self._get_block(node)) + self._apply_annotations_callable(node, chain, block=self._get_block(node)) if isinstance(node, (ast.Class, ast.Interface, ast.Union, ast.Enum, ast.Bitfield, ast.Callback)): self._apply_annotations_annotated(node, self._get_block(node)) @@ -234,13 +228,13 @@ usage is void (*_gtk_reserved1)(void);""" if isinstance(node, ast.Class): block = self._get_block(node) if block: - tag = block.get_tag(TAG_UNREF_FUNC) + tag = block.tags.get(TAG_UNREF_FUNC) node.unref_func = tag.value if tag else None - tag = block.get_tag(TAG_REF_FUNC) + tag = block.tags.get(TAG_REF_FUNC) node.ref_func = tag.value if tag else None - tag = block.get_tag(TAG_SET_VALUE_FUNC) + tag = block.tags.get(TAG_SET_VALUE_FUNC) node.set_value_func = tag.value if tag else None - tag = block.get_tag(TAG_GET_VALUE_FUNC) + tag = block.tags.get(TAG_GET_VALUE_FUNC) node.get_value_func = tag.value if tag else None if isinstance(node, ast.Constant): self._apply_annotations_constant(node) @@ -264,7 +258,7 @@ usage is void (*_gtk_reserved1)(void);""" Use resolver() on each identifier, and combiner() on the parts of each complete type. (top_combiner is used on the top-most type.)""" bits = re.split(r'([,<>()])', type_str, 1) - first, sep, rest = [bits[0], '', ''] if (len(bits)==1) else bits + first, sep, rest = [bits[0], '', ''] if (len(bits) == 1) else bits args = [resolver(first)] if sep == '<' or sep == '(': lastsep = '>' if (sep == '<') else ')' @@ -275,9 +269,11 @@ usage is void (*_gtk_reserved1)(void);""" else: rest = sep + rest return top_combiner(*args), rest + def resolver(ident): res = self._transformer.create_type_from_user_string(ident) return res + def combiner(base, *rest): if not rest: return base @@ -288,6 +284,7 @@ usage is void (*_gtk_reserved1)(void);""" message.warn( "Too many parameters in type specification %r" % (type_str, )) return base + def top_combiner(base, *rest): if type_node is not None and isinstance(type_node, ast.Type): base.is_const = type_node.is_const @@ -334,24 +331,23 @@ usage is void (*_gtk_reserved1)(void);""" return block.position def _check_array_element_type(self, array, options): + array_type = array.array_type + element_type = array.element_type + # GPtrArrays are allowed to contain non basic types # (except enums and flags) or basic types that are # as big as a gpointer - if array.array_type == ast.Array.GLIB_PTRARRAY and \ - ((array.element_type in ast.BASIC_GIR_TYPES - and not array.element_type in ast.POINTER_TYPES) or - isinstance(array.element_type, ast.Enum) or - isinstance(array.element_type, ast.Bitfield)): - message.warn("invalid (element-type) for a GPtrArray, " - "must be a pointer", options.position) + if array_type == ast.Array.GLIB_PTRARRAY: + if ((element_type in ast.BASIC_GIR_TYPES and not element_type in ast.POINTER_TYPES) + or isinstance(element_type, (ast.Enum, ast.Bitfield))): + message.warn("invalid (element-type) for a GPtrArray, " + "must be a pointer", options.position) # GByteArrays have (element-type) guint8 by default - if array.array_type == ast.Array.GLIB_BYTEARRAY: - if array.element_type == ast.TYPE_ANY: + if array_type == ast.Array.GLIB_BYTEARRAY: + if element_type == ast.TYPE_ANY: array.element_type = ast.TYPE_UINT8 - elif not array.element_type in [ast.TYPE_UINT8, - ast.TYPE_INT8, - ast.TYPE_CHAR]: + elif not element_type in [ast.TYPE_UINT8, ast.TYPE_INT8, ast.TYPE_CHAR]: message.warn("invalid (element-type) for a GByteArray, " "must be one of guint8, gint8 or gchar", options.position) @@ -461,8 +457,8 @@ usage is void (*_gtk_reserved1)(void);""" def _get_transfer_default_returntype_basic(self, typeval): if (typeval.is_equiv(ast.BASIC_GIR_TYPES) - or typeval.is_const - or typeval.is_equiv(ast.TYPE_NONE)): + or typeval.is_const + or typeval.is_equiv(ast.TYPE_NONE)): return ast.PARAM_TRANSFER_NONE elif typeval.is_equiv(ast.TYPE_STRING): # Non-const strings default to FULL @@ -542,8 +538,7 @@ usage is void (*_gtk_reserved1)(void);""" caller_allocates = False annotated_direction = None - if (OPT_INOUT in options or - OPT_INOUT_ALT in options): + if (OPT_INOUT in options or OPT_INOUT_ALT in options): annotated_direction = ast.PARAM_DIRECTION_INOUT elif OPT_OUT in options: subtype = options[OPT_OUT] @@ -581,9 +576,9 @@ usage is void (*_gtk_reserved1)(void);""" self._adjust_container_type(parent, node, options) - if (OPT_ALLOW_NONE in options or - node.type.target_giname == 'Gio.AsyncReadyCallback' or - node.type.target_giname == 'Gio.Cancellable'): + if (OPT_ALLOW_NONE in options + or node.type.target_giname == 'Gio.AsyncReadyCallback' + or node.type.target_giname == 'Gio.Cancellable'): node.allow_none = True if tag is not None and tag.comment is not None: @@ -602,17 +597,17 @@ usage is void (*_gtk_reserved1)(void);""" node.doc = block.comment if block.comment else '' - since_tag = block.get_tag(TAG_SINCE) + since_tag = block.tags.get(TAG_SINCE) if since_tag is not None: node.version = since_tag.value - deprecated_tag = block.get_tag(TAG_DEPRECATED) + deprecated_tag = block.tags.get(TAG_DEPRECATED) if deprecated_tag is not None: value = deprecated_tag.value if ': ' in value: colon = value.find(': ') version = value[:colon] - desc = value[colon+2:] + desc = value[colon + 2:] else: desc = value version = None @@ -620,7 +615,7 @@ usage is void (*_gtk_reserved1)(void);""" if version is not None: node.deprecated_version = version - stability_tag = block.get_tag(TAG_STABILITY) + stability_tag = block.tags.get(TAG_STABILITY) if stability_tag is not None: stability = stability_tag.value.capitalize() if stability in ["Stable", "Unstable", "Private", "Internal"]: @@ -629,7 +624,7 @@ usage is void (*_gtk_reserved1)(void);""" message.warn('unknown value "%s" for Stability tag' % ( stability_tag.value), stability_tag.position) - annos_tag = block.get_tag(TAG_ATTRIBUTES) + annos_tag = block.tags.get(TAG_ATTRIBUTES) if annos_tag is not None: for key, value in annos_tag.options.items(): if value: @@ -691,7 +686,7 @@ usage is void (*_gtk_reserved1)(void);""" def _apply_annotations_return(self, parent, return_, block): if block: - tag = block.get_tag(TAG_RETURNS) + tag = block.tags.get(TAG_RETURNS) else: tag = None self._apply_annotations_param_ret_common(parent, return_, tag) @@ -702,7 +697,7 @@ usage is void (*_gtk_reserved1)(void);""" declparams.add(parent.instance_parameter.argname) for param in params: if block: - tag = block.get_param(param.argname) + tag = block.params.get(param.argname) else: tag = None self._apply_annotations_param(parent, param, tag) @@ -725,10 +720,9 @@ usage is void (*_gtk_reserved1)(void);""" (param, ) = unused text = ', should be %r' % (param, ) else: - text = ', should be one of %s' % ( - ', '.join(repr(p) for p in unused), ) + text = ', should be one of %s' % (', '.join(repr(p) for p in unused), ) - tag = block.get_param(doc_name) + tag = block.params.get(doc_name) message.warn( '%s: unknown parameter %r in documentation comment%s' % ( block.name, doc_name, text), @@ -756,7 +750,7 @@ usage is void (*_gtk_reserved1)(void);""" def _apply_annotations_field(self, parent, block, field): if not block: return - tag = block.get_param(field.name) + tag = block.params.get(field.name) if not tag: return t = tag.options.get(OPT_TYPE) @@ -774,7 +768,7 @@ usage is void (*_gtk_reserved1)(void);""" self._apply_annotations_annotated(prop, block) if not block: return - transfer_tag = block.get_tag(TAG_TRANSFER) + transfer_tag = block.tags.get(TAG_TRANSFER) if transfer_tag is not None: transfer = transfer_tag.value if transfer == OPT_TRANSFER_FLOATING: @@ -782,28 +776,36 @@ usage is void (*_gtk_reserved1)(void);""" prop.transfer = transfer else: prop.transfer = self._get_transfer_default(parent, prop) - type_tag = block.get_tag(TAG_TYPE) + type_tag = block.tags.get(TAG_TYPE) if type_tag: prop.type = self._resolve_toplevel(type_tag.value, prop.type, prop, parent) def _apply_annotations_signal(self, parent, signal): + names = [] prefix = self._get_annotation_name(parent) block = self._blocks.get('%s::%s' % (prefix, signal.name)) - self._apply_annotations_annotated(signal, block) - # We're only attempting to name the signal parameters if - # the number of parameters (@foo) is the same or greater - # than the number of signal parameters - if block and len(block.params) > len(signal.parameters): - names = block.params.items() - # Resolve real parameter names early, so that in later - # phase we can refer to them while resolving annotations. - for i, param in enumerate(signal.parameters): - param.argname, tag = names[i+1] - else: - names = [] + + if block: + self._apply_annotations_annotated(signal, block) + + # We're only attempting to name the signal parameters if + # the number of parameters (@foo) is the same or greater + # than the number of signal parameters + if len(block.params) > len(signal.parameters): + names = block.params.items() + # Resolve real parameter names early, so that in later + # phase we can refer to them while resolving annotations. + for i, param in enumerate(signal.parameters): + param.argname, tag = names[i + 1] + elif len(signal.parameters) != 0: + # Only warn about missing params if there are actually parameters + # besides implicit self. + message.warn("incorrect number of parameters in comment block, " + "parameter annotations will be ignored.", block.position) + for i, param in enumerate(signal.parameters): if names: - name, tag = names[i+1] + name, tag = names[i + 1] options = getattr(tag, 'options', {}) param_type = options.get(OPT_TYPE) if param_type: @@ -821,7 +823,7 @@ usage is void (*_gtk_reserved1)(void);""" self._apply_annotations_annotated(node, block) - tag = block.get_tag(TAG_VALUE) + tag = block.tags.get(TAG_VALUE) if tag: node.value = tag.value @@ -836,34 +838,30 @@ usage is void (*_gtk_reserved1)(void);""" def _pass_read_annotations2(self, node, chain): if isinstance(node, ast.Function): - self._apply_annotations2_function(node, chain) + block = self._blocks.get(node.symbol) + + self._apply_annotation_rename_to(node, chain, block) + + # Handle virtual invokers + parent = chain[-1] if chain else None + if (block and parent): + virtual_annotation = block.tags.get(TAG_VFUNC) + if virtual_annotation: + invoker_name = virtual_annotation.value + matched = False + for vfunc in parent.virtual_methods: + if vfunc.name == invoker_name: + matched = True + vfunc.invoker = node.name + # Also merge in annotations + self._apply_annotations_callable(vfunc, [parent], block) + break + if not matched: + message.warn_node(node, + "Virtual slot %r not found for %r annotation" % (invoker_name, + TAG_VFUNC)) return True - def _apply_annotations2_function(self, node, chain): - block = self._blocks.get(node.symbol) - - self._apply_annotation_rename_to(node, chain, block) - - # Handle virtual invokers - parent = chain[-1] if chain else None - if not (block and parent): - return - virtual = block.get_tag(TAG_VFUNC) - if not virtual: - return - invoker_name = virtual.value - matched = False - for vfunc in parent.virtual_methods: - if vfunc.name == invoker_name: - matched = True - vfunc.invoker = node.name - # Also merge in annotations - self._apply_annotations_callable(vfunc, [parent], block) - break - if not matched: - message.warn_node(node, - "Virtual slot %r not found for %r annotation" % (invoker_name, TAG_VFUNC)) - def _resolve_and_filter_type_list(self, typelist): """Given a list of Type instances, return a new list of types with the ones that failed to resolve removed.""" @@ -1169,9 +1167,9 @@ method or constructor of some type.""" origin_node = self._get_constructor_class(func, subsymbol) if origin_node is None: if func.is_constructor: - message.warn_node(func, - "Can't find matching type for constructor; symbol=%r" \ - % (func.symbol, )) + message.warn_node( + func, + "Can't find matching type for constructor; symbol=%r" % (func.symbol, )) return False # Some sanity checks; only objects and boxeds can have ctors diff --git a/giscanner/message.py b/giscanner/message.py index 8a948cd..3a330af 100644 --- a/giscanner/message.py +++ b/giscanner/message.py @@ -61,7 +61,7 @@ class Position(object): return '%s:' % (filename, ) def offset(self, offset): - return Position(self.filename, self.line+offset, self.column) + return Position(self.filename, self.line + offset, self.column) class MessageLogger(object): @@ -119,16 +119,14 @@ If the warning is related to a ast.Node type, see log_node().""" elif log_type == FATAL: error_type = "Fatal" if prefix: - text = ( -'''%s: %s: %s: %s: %s\n''' % (last_position, error_type, self._namespace.name, - prefix, text)) + text = ('%s: %s: %s: %s: %s\n' % (last_position, error_type, + self._namespace.name, prefix, text)) else: if self._namespace: - text = ( -'''%s: %s: %s: %s\n''' % (last_position, error_type, self._namespace.name, text)) + text = ('%s: %s: %s: %s\n' % (last_position, error_type, + self._namespace.name, text)) else: - text = ( -'''%s: %s: %s\n''' % (last_position, error_type, text)) + text = ('%s: %s: %s\n' % (last_position, error_type, text)) self._output.write(text) if log_type == FATAL: @@ -169,17 +167,21 @@ def log_node(log_type, node, text, context=None, positions=None): ml = MessageLogger.get() ml.log_node(log_type, node, text, context=context, positions=positions) + def warn(text, positions=None, prefix=None): ml = MessageLogger.get() ml.log(WARNING, text, positions, prefix) + def warn_node(node, text, context=None, positions=None): log_node(WARNING, node, text, context=context, positions=positions) + def warn_symbol(symbol, text): ml = MessageLogger.get() ml.log_symbol(WARNING, symbol, text) + def fatal(text, positions=None, prefix=None): ml = MessageLogger.get() ml.log(FATAL, text, positions, prefix) diff --git a/giscanner/odict.py b/giscanner/odict.py deleted file mode 100644 index fa164c3..0000000 --- a/giscanner/odict.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- Mode: Python -*- -# GObject-Introspection - a framework for introspecting GObject libraries -# Copyright (C) 2008 Johan Dahlin -# -# 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 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. -# - -"""odict - an ordered dictionary""" - -try: - # Starting with Python 2.7 we can use collections.OrderedDict - from collections import OrderedDict as odict -except ImportError: - # But we still support Python 2.5 and 2.6 - from UserDict import DictMixin - - - class odict(DictMixin): - - def __init__(self): - self._items = {} - self._keys = [] - - def __setitem__(self, key, value): - if key not in self._items: - self._keys.append(key) - self._items[key] = value - - def __getitem__(self, key): - return self._items[key] - - def __delitem__(self, key): - del self._items[key] - self._keys.remove(key) - - def keys(self): - return self._keys[:] diff --git a/giscanner/scannerlexer.l b/giscanner/scannerlexer.l index a783ec0..554e2da 100644 --- a/giscanner/scannerlexer.l +++ b/giscanner/scannerlexer.l @@ -46,6 +46,7 @@ char linebuf[2000]; extern int yylex (GISourceScanner *scanner); #define YY_DECL int yylex (GISourceScanner *scanner) static int yywrap (void); +static void parse_gtk_doc_comment (GISourceScanner *scanner); static void parse_comment (GISourceScanner *scanner); static void parse_trigraph (GISourceScanner *scanner); static void process_linemarks (GISourceScanner *scanner); @@ -71,8 +72,10 @@ stringtext ([^\\\"])|(\\.) ++lineno; } "\\\n" { ++lineno; } + [\t\f\v\r ]+ { /* Ignore whitespace. */ } +"/**" { parse_gtk_doc_comment(scanner); } "/*" { parse_comment(scanner); } "/*"[\t ]?<[\t ,=A-Za-z0-9_]+>[\t ]?"*/" { parse_trigraph(scanner); } "//".* { /* Ignore C++ style comments. */ } @@ -134,6 +137,8 @@ stringtext ([^\\\"])|(\\.) "," { return ','; } "->" { return ARROW; } +"__asm"[\t\f\v\r ]+"volatile" { if (!parse_ignored_macro()) REJECT; } +"__asm__"[\t\f\v\r ]+"volatile" { if (!parse_ignored_macro()) REJECT; } "__asm" { if (!parse_ignored_macro()) REJECT; } "__asm__" { if (!parse_ignored_macro()) REJECT; } "__attribute__" { if (!parse_ignored_macro()) REJECT; } @@ -145,6 +150,8 @@ stringtext ([^\\\"])|(\\.) "__signed__" { return SIGNED; } "__restrict" { return RESTRICT; } "__typeof" { if (!parse_ignored_macro()) REJECT; } +"__volatile" { if (!parse_ignored_macro()) REJECT; } +"__volatile__" { if (!parse_ignored_macro()) REJECT; } "_Bool" { return BOOL; } "G_GINT64_CONSTANT" { return INTL_CONST; } @@ -170,6 +177,10 @@ stringtext ([^\\\"])|(\\.) "if" { return IF; } "inline" { return INLINE; } "int" { return INT; } +"__uint128_t" { return INT; } +"__int128_t" { return INT; } +"__uint128" { return INT; } +"__int128" { return INT; } "long" { return LONG; } "register" { return REGISTER; } "restrict" { return RESTRICT; } @@ -212,9 +223,8 @@ yywrap (void) return 1; } - static void -parse_comment (GISourceScanner *scanner) +parse_gtk_doc_comment (GISourceScanner *scanner) { GString *string = NULL; int c1, c2; @@ -227,7 +237,7 @@ parse_comment (GISourceScanner *scanner) (GCompareFunc)g_strcmp0)) { skip = TRUE; } else { - string = g_string_new ("/*"); + string = g_string_new (yytext); } c1 = input(); @@ -262,6 +272,26 @@ parse_comment (GISourceScanner *scanner) comment); } +static void +parse_comment (GISourceScanner *scanner) +{ + int c1, c2; + + c1 = input(); + c2 = input(); + + while (c2 != EOF && !(c1 == '*' && c2 == '/')) + { + if (c1 == '\n') + lineno++; + + c1 = c2; + c2 = input(); + } + + return; +} + static int check_identifier (GISourceScanner *scanner, const char *s) diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py index 42867f0..00dc30d 100755 --- a/giscanner/scannermain.py +++ b/giscanner/scannermain.py @@ -38,18 +38,21 @@ from giscanner.girparser import GIRParser from giscanner.girwriter import GIRWriter from giscanner.maintransformer import MainTransformer from giscanner.shlibs import resolve_shlibs -from giscanner.sourcescanner import SourceScanner +from giscanner.sourcescanner import SourceScanner, ALL_EXTS from giscanner.transformer import Transformer from . import utils + def process_cflags_begin(option, opt, value, parser): cflags = getattr(parser.values, option.dest) while len(parser.rargs) > 0 and parser.rargs[0] != '--cflags-end': cflags.append(parser.rargs.pop(0)) + def process_cflags_end(option, opt, value, parser): pass + def get_preprocessor_option_group(parser): group = optparse.OptionGroup(parser, "Preprocessor options") group.add_option("", "--cflags-begin", @@ -71,6 +74,7 @@ def get_preprocessor_option_group(parser): group.add_option("-p", dest="", help="Ignored") return group + def get_windows_option_group(parser): group = optparse.OptionGroup(parser, "Machine Dependent Options") group.add_option("-m", help="some machine dependent option", @@ -79,13 +83,13 @@ def get_windows_option_group(parser): return group + def _get_option_parser(): parser = optparse.OptionParser('%prog [options] sources') parser.add_option('', "--quiet", action="store_true", dest="quiet", default=False, - help="If passed, do not print details of normal" \ - + " operation") + help="If passed, do not print details of normal operation") parser.add_option("", "--format", action="store", dest="format", default="gir", @@ -204,6 +208,7 @@ match the namespace prefix.""") def _error(msg): raise SystemExit('ERROR: %s' % (msg, )) + def passthrough_gir(path, f): parser = GIRParser() parser.parse(path) @@ -211,6 +216,7 @@ def passthrough_gir(path, f): writer = GIRWriter(parser.get_namespace()) f.write(writer.get_xml()) + def test_codegen(optstring): (namespace, out_h_filename, out_c_filename) = optstring.split(',') if namespace == 'Everything': @@ -221,6 +227,7 @@ def test_codegen(optstring): _error("Invaild namespace %r" % (namespace, )) return 0 + def process_options(output, allowed_flags): for option in output.split(): for flag in allowed_flags: @@ -229,6 +236,7 @@ def process_options(output, allowed_flags): yield option break + def process_packages(options, packages): args = ['pkg-config', '--cflags'] args.extend(packages) @@ -248,15 +256,13 @@ def process_packages(options, packages): options.cpp_defines.extend(pkg_options.cpp_defines) options.cpp_undefines.extend(pkg_options.cpp_undefines) + def extract_filenames(args): filenames = [] for arg in args: # We don't support real C++ parsing yet, but we should be able # to understand C API implemented in C++ files. - if (arg.endswith('.c') or arg.endswith('.cpp') or - arg.endswith('.cc') or arg.endswith('.cxx') or - arg.endswith('.h') or arg.endswith('.hpp') or - arg.endswith('.hxx')): + if os.path.splitext(arg)[1] in ALL_EXTS: if not os.path.exists(arg): _error('%s: no such a file or directory' % (arg, )) # Make absolute, because we do comparisons inside scannerparser.c @@ -264,6 +270,7 @@ def extract_filenames(args): filenames.append(os.path.abspath(arg)) return filenames + def extract_filelist(options): filenames = [] if not os.path.exists(options.filelist): @@ -274,10 +281,10 @@ def extract_filelist(options): # We don't support real C++ parsing yet, but we should be able # to understand C API implemented in C++ files. filename = line.strip() - if (filename.endswith('.c') or filename.endswith('.cpp') or - filename.endswith('.cc') or filename.endswith('.cxx') or - filename.endswith('.h') or filename.endswith('.hpp') or - filename.endswith('.hxx')): + if (filename.endswith('.c') or filename.endswith('.cpp') + or filename.endswith('.cc') or filename.endswith('.cxx') + or filename.endswith('.h') or filename.endswith('.hpp') + or filename.endswith('.hxx')): if not os.path.exists(filename): _error('%s: Invalid filelist entry-no such file or directory' % (line, )) # Make absolute, because we do comparisons inside scannerparser.c @@ -285,6 +292,7 @@ def extract_filelist(options): filenames.append(os.path.abspath(filename)) return filenames + def create_namespace(options): if options.strip_prefix: print """g-ir-scanner: warning: Option --strip-prefix has been deprecated; @@ -313,6 +321,7 @@ see --identifier-prefix and --symbol-prefix.""" identifier_prefixes=identifier_prefixes, symbol_prefixes=symbol_prefixes) + def create_transformer(namespace, options): transformer = Transformer(namespace, accept_unprefixed=options.accept_unprefixed) @@ -334,6 +343,7 @@ def create_transformer(namespace, options): return transformer + def create_binary(transformer, options, args): # Transform the C AST nodes into higher level # GLib/GObject nodes @@ -344,7 +354,7 @@ def create_binary(transformer, options, args): gdump_parser.init_parse() if options.program: - args=[options.program] + args = [options.program] args.extend(options.program_args) binary = IntrospectionBinary(args) else: @@ -357,6 +367,7 @@ def create_binary(transformer, options, args): gdump_parser.parse() return shlibs + def create_source_scanner(options, args): if hasattr(options, 'filelist') and options.filelist: filenames = extract_filelist(options) @@ -374,6 +385,7 @@ def create_source_scanner(options, args): ss.parse_macros(filenames) return ss + def write_output(data, options): if options.output == "-": output = sys.stdout @@ -393,7 +405,7 @@ def write_output(data, options): os.unlink(temp_f_name) try: shutil.move(main_f_name, options.output) - except OSError, e: + except OSError as e: if e.errno == errno.EPERM: os.unlink(main_f_name) return 0 @@ -402,14 +414,15 @@ def write_output(data, options): else: try: output = open(options.output, "w") - except IOError, e: + except IOError as e: _error("opening output for writing: %s" % (e.strerror, )) try: output.write(data) - except IOError, e: + except IOError as e: _error("while writing output: %s" % (e.strerror, )) + def scanner_main(args): parser = _get_option_parser() (options, args) = parser.parse_args(args) @@ -455,7 +468,6 @@ def scanner_main(args): blocks = ap.parse(ss.get_comments()) # Transform the C symbols into AST nodes - transformer.set_annotations(blocks) transformer.parse(ss.get_symbols()) if not options.header_only: diff --git a/giscanner/sectionparser.py b/giscanner/sectionparser.py index caf6bf2..61763e4 100644 --- a/giscanner/sectionparser.py +++ b/giscanner/sectionparser.py @@ -18,24 +18,27 @@ # import re -import sys -class SectionFile(object): + +class SectionsFile(object): def __init__(self, sections): self.sections = sections + class Section(object): def __init__(self): self.file = None self.title = None - self.main_subsection = Subsection(None) + self.includes = None self.subsections = [] + class Subsection(object): def __init__(self, name): self.name = name self.symbols = [] + def parse_sections_file(lines): sections = [] current_section = None @@ -50,29 +53,39 @@ def parse_sections_file(lines): if line == "
": current_section = Section() sections.append(current_section) - current_subsection = current_section.main_subsection + current_subsection = Subsection(None) + current_section.subsections.append(current_subsection) continue if line == "
": current_section = None continue - match = re.match(line, r"(?P.*)") + match = re.match(r"(?P.*)", line) if match: current_section.file = match.groupdict['contents'] continue - match = re.match(line, r"(?P<contents>.*)") + match = re.match(r"(?P<contents>.*)", line) if match: current_section.title = match.groupdict['contents'] continue - match = re.match(line, r").*>") + match = re.match(r"(?P.*)", line) if match: - current_subsection = Section(match.groupdict['name']) + current_section.includes = match.groupdict['contents'] + continue + + match = re.match(r".*))?>", line) + if match: + current_subsection = Subsection(match.groupdict.get('name', None)) current_section.subsections.append(current_subsection) continue + if line.startswith("<") and line.endswith(">"): + # Other directive to gtk-doc, not a symbol. + continue + current_subsection.symbols.append(line) - return SectionFile(sections) + return SectionsFile(sections) diff --git a/giscanner/shlibs.py b/giscanner/shlibs.py index 6c583a4..1241827 100644 --- a/giscanner/shlibs.py +++ b/giscanner/shlibs.py @@ -26,6 +26,7 @@ import subprocess from .utils import get_libtool_command, extract_libtool_shlib + # For .la files, the situation is easy. def _resolve_libtool(options, binary, libraries): shlibs = [] @@ -36,6 +37,7 @@ def _resolve_libtool(options, binary, libraries): return shlibs + # Assume ldd output is something vaguely like # # libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x006c1000) @@ -51,6 +53,7 @@ def _ldd_library_pattern(library_name): return re.compile("(? of -l) # against a library to find the shared library name. The shared # library name is suppose to be what you pass to dlopen() (or diff --git a/giscanner/sourcescanner.py b/giscanner/sourcescanner.py index de13776..d5c4392 100644 --- a/giscanner/sourcescanner.py +++ b/giscanner/sourcescanner.py @@ -32,6 +32,10 @@ with LibtoolImporter(None, None): else: from giscanner._giscanner import SourceScanner as CSourceScanner +HEADER_EXTS = ['.h', '.hpp', '.hxx'] +SOURCE_EXTS = ['.c', '.cpp', '.cc', '.cxx'] +ALL_EXTS = SOURCE_EXTS + HEADER_EXTS + (CSYMBOL_TYPE_INVALID, CSYMBOL_TYPE_ELLIPSIS, CSYMBOL_TYPE_CONST, @@ -89,8 +93,7 @@ def symbol_type_name(symbol_type): CSYMBOL_TYPE_UNION: 'union', CSYMBOL_TYPE_ENUM: 'enum', CSYMBOL_TYPE_TYPEDEF: 'typedef', - CSYMBOL_TYPE_MEMBER: 'member', - }.get(symbol_type) + CSYMBOL_TYPE_MEMBER: 'member'}.get(symbol_type) def ctype_name(ctype): @@ -104,8 +107,7 @@ def ctype_name(ctype): CTYPE_ENUM: 'enum', CTYPE_POINTER: 'pointer', CTYPE_ARRAY: 'array', - CTYPE_FUNCTION: 'function', - }.get(ctype) + CTYPE_FUNCTION: 'function'}.get(ctype) class SourceType(object): @@ -241,8 +243,7 @@ class SourceScanner(object): headers = [] for filename in filenames: - if (filename.endswith('.c') or filename.endswith('.cpp') or - filename.endswith('.cc') or filename.endswith('.cxx')): + if os.path.splitext(filename)[1] in SOURCE_EXTS: filename = os.path.abspath(filename) self._scanner.lex_filename(filename) else: @@ -263,7 +264,7 @@ class SourceScanner(object): return self._scanner.get_comments() def dump(self): - print '-'*30 + print '-' * 30 for symbol in self._scanner.get_symbols(): print symbol.ident, symbol.base_type.name, symbol.type @@ -275,19 +276,17 @@ class SourceScanner(object): defines = ['__GI_SCANNER__'] undefs = [] - cpp_exec = os.environ.get('CC', 'cc').split() - # The Microsoft compiler/preprocessor (cl) does not accept - # source input from stdin (the '-' flag), so we need - # some help from gcc from MinGW/Cygwin or so. - # Note that the generated dumper program is - # still built and linked by Visual C++. - if 'cl' in cpp_exec: - cpp_args = 'gcc'.split() - else: - cpp_args = cpp_exec + cpp_args = os.environ.get('CC', 'cc').split() # support CC="ccache gcc" + if 'cl' in cpp_args: + # The Microsoft compiler/preprocessor (cl) does not accept + # source input from stdin (the '-' flag), so we need + # some help from gcc from MinGW/Cygwin or so. + # Note that the generated dumper program is + # still built and linked by Visual C++. + cpp_args = ['gcc'] cpp_args += ['-E', '-C', '-I.', '-'] - cpp_args += self._cpp_options + proc = subprocess.Popen(cpp_args, stdin=subprocess.PIPE, stdout=subprocess.PIPE) @@ -303,8 +302,8 @@ class SourceScanner(object): proc.stdin.write('#include <%s>\n' % (filename, )) proc.stdin.close() - tmp = tempfile.mktemp() - fp = open(tmp, 'w+') + tmp_fd, tmp_name = tempfile.mkstemp() + fp = os.fdopen(tmp_fd, 'w+b') while True: data = proc.stdout.read(4096) if data is None: @@ -321,4 +320,4 @@ class SourceScanner(object): self._scanner.parse_file(fp.fileno()) fp.close() - os.unlink(tmp) + os.unlink(tmp_name) diff --git a/giscanner/testcodegen.py b/giscanner/testcodegen.py index f304dc7..1ed247c 100644 --- a/giscanner/testcodegen.py +++ b/giscanner/testcodegen.py @@ -27,12 +27,14 @@ DEFAULT_C_VALUES = {ast.TYPE_ANY: 'NULL', ast.TYPE_FILENAME: '""', ast.TYPE_GTYPE: 'g_object_get_type ()'} + def get_default_for_typeval(typeval): default = DEFAULT_C_VALUES.get(typeval) if default: return default return "0" + def uscore_from_type(typeval): if typeval.target_fundamental: return typeval.target_fundamental.replace(' ', '_') @@ -41,6 +43,7 @@ def uscore_from_type(typeval): else: assert False, typeval + class EverythingCodeGenerator(object): def __init__(self, out_h_filename, out_c_filename): diff --git a/giscanner/transformer.py b/giscanner/transformer.py index 3513fc8..f70d756 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -34,6 +34,7 @@ from .sourcescanner import ( CSYMBOL_TYPE_MEMBER, CSYMBOL_TYPE_ELLIPSIS, CSYMBOL_TYPE_CONST, TYPE_QUALIFIER_CONST, TYPE_QUALIFIER_VOLATILE) + class TransformerException(Exception): pass @@ -54,10 +55,9 @@ class Transformer(object): self._namespace = namespace self._pkg_config_packages = set() self._typedefs_ns = {} - self._parsed_includes = {} # Namespace> + self._parsed_includes = {} # Namespace> self._includepaths = [] self._passthrough_mode = False - self._annotations = {} def get_pkgconfig_packages(self): return self._pkg_config_packages @@ -68,9 +68,6 @@ class Transformer(object): def set_passthrough_mode(self): self._passthrough_mode = True - def set_annotations(self, annotations): - self._annotations = annotations - def _append_new_node(self, node): original = self._namespace.get(node.name) # Special case constants here; we allow duplication to sort-of @@ -108,7 +105,7 @@ class Transformer(object): if not ns_compound: ns_compound = self._namespace.get('_' + compound.name) if (not ns_compound and isinstance(compound, (ast.Record, ast.Union)) - and len(compound.fields) == 0): + and len(compound.fields) == 0): disguised = ast.Record(compound.name, typedef, disguised=True) self._namespace.append(disguised) elif not ns_compound: @@ -130,8 +127,8 @@ class Transformer(object): def register_include_uninstalled(self, include_path): basename = os.path.basename(include_path) if not basename.endswith('.gir'): - raise SystemExit( -"Include path %r must be a filename path ending in .gir" % (include_path, )) + raise SystemExit("Include path %r must be a filename path " + "ending in .gir" % (include_path, )) girname = basename[:-4] include = ast.Include.from_string(girname) if include in self._namespace.includes: @@ -179,8 +176,7 @@ None.""" path = os.path.join(d, girname) if os.path.exists(path): return path - sys.stderr.write("Couldn't find include %r (search path: %r)\n"\ - % (girname, searchdirs)) + sys.stderr.write("Couldn't find include %r (search path: %r)\n" % (girname, searchdirs)) sys.exit(1) @classmethod @@ -232,7 +228,7 @@ currently-scanned namespace is first.""" def _split_c_string_for_namespace_matches(self, name, is_identifier=False): matches = [] # Namespaces which might contain this name - unprefixed_namespaces = [] # Namespaces with no prefix, last resort + unprefixed_namespaces = [] # Namespaces with no prefix, last resort for ns in self._iter_namespaces(): if is_identifier: prefixes = ns.identifier_prefixes @@ -289,7 +285,7 @@ raise ValueError.""" ident = ident[1:] try: matches = self.split_ctype_namespaces(ident) - except ValueError, e: + except ValueError as e: raise TransformerException(str(e)) for ns, name in matches: if ns is self._namespace: @@ -309,7 +305,7 @@ raise ValueError.""" ident = ident[1:] try: (ns, name) = self.split_csymbol(ident) - except ValueError, e: + except ValueError as e: raise TransformerException(str(e)) if ns != self._namespace: raise TransformerException( @@ -383,7 +379,7 @@ raise ValueError.""" # prefix. try: name = self._strip_symbol(child) - except TransformerException, e: + except TransformerException as e: message.warn_symbol(symbol, e) return None members.append(ast.Member(name.lower(), @@ -393,7 +389,7 @@ raise ValueError.""" try: enum_name = self.strip_identifier(symbol.ident) - except TransformerException, e: + except TransformerException as e: message.warn_symbol(symbol, e) return None if symbol.base_type.is_bitfield: @@ -412,7 +408,7 @@ raise ValueError.""" return_ = self._create_return(symbol.base_type.base_type) try: name = self._strip_symbol(symbol) - except TransformerException, e: + except TransformerException as e: message.warn_symbol(symbol, e) return None func = ast.Function(name, return_, parameters, False, symbol.ident) @@ -506,8 +502,8 @@ raise ValueError.""" def _create_member(self, symbol, parent_symbol=None): source_type = symbol.base_type - if (source_type.type == CTYPE_POINTER and - symbol.base_type.base_type.type == CTYPE_FUNCTION): + if (source_type.type == CTYPE_POINTER + and symbol.base_type.base_type.type == CTYPE_FUNCTION): node = self._create_callback(symbol, member=True) elif source_type.type == CTYPE_STRUCT and source_type.name is None: node = self._create_struct(symbol, anonymous=True) @@ -523,8 +519,8 @@ raise ValueError.""" # to be able to properly calculate the size of the compound # type (e.g. GValue) that contains this array, see # . - if (source_type.base_type.type == CTYPE_UNION and - source_type.base_type.name is None): + if (source_type.base_type.type == CTYPE_UNION + and source_type.base_type.name is None): synthesized_type = self._synthesize_union_type(symbol, parent_symbol) ftype = ast.Array(None, synthesized_type, complete_ctype=complete_ctype) else: @@ -562,11 +558,9 @@ raise ValueError.""" def _create_typedef(self, symbol): ctype = symbol.base_type.type - if (ctype == CTYPE_POINTER and - symbol.base_type.base_type.type == CTYPE_FUNCTION): + if (ctype == CTYPE_POINTER and symbol.base_type.base_type.type == CTYPE_FUNCTION): node = self._create_typedef_callback(symbol) - elif (ctype == CTYPE_POINTER and - symbol.base_type.base_type.type == CTYPE_STRUCT): + elif (ctype == CTYPE_POINTER and symbol.base_type.base_type.type == CTYPE_STRUCT): node = self._create_typedef_struct(symbol, disguised=True) elif ctype == CTYPE_STRUCT: node = self._create_typedef_struct(symbol) @@ -580,7 +574,7 @@ raise ValueError.""" CTYPE_VOID): try: name = self.strip_identifier(symbol.ident) - except TransformerException, e: + except TransformerException as e: message.warn(e) return None if symbol.base_type.name: @@ -631,8 +625,7 @@ raise ValueError.""" derefed_typename = canonical.replace('*', '') # Preserve "pointerness" of struct/union members - if (is_member and canonical.endswith('*') and - derefed_typename in ast.basic_type_names): + if (is_member and canonical.endswith('*') and derefed_typename in ast.basic_type_names): return 'gpointer' else: return derefed_typename @@ -718,12 +711,11 @@ raise ValueError.""" # Don't create constants for non-public things # http://bugzilla.gnome.org/show_bug.cgi?id=572790 - if (symbol.source_filename is None or - not symbol.source_filename.endswith('.h')): + if (symbol.source_filename is None or not symbol.source_filename.endswith('.h')): return None try: name = self._strip_symbol(symbol) - except TransformerException, e: + except TransformerException as e: message.warn_symbol(symbol, e) return None if symbol.const_string is not None: @@ -742,13 +734,13 @@ raise ValueError.""" if isinstance(target, ast.Type): unaliased = target if unaliased == ast.TYPE_UINT64: - value = str(symbol.const_int % 2**64) + value = str(symbol.const_int % 2 ** 64) elif unaliased == ast.TYPE_UINT32: - value = str(symbol.const_int % 2**32) + value = str(symbol.const_int % 2 ** 32) elif unaliased == ast.TYPE_UINT16: - value = str(symbol.const_int % 2**16) + value = str(symbol.const_int % 2 ** 16) elif unaliased == ast.TYPE_UINT8: - value = str(symbol.const_int % 2**16) + value = str(symbol.const_int % 2 ** 16) else: value = str(symbol.const_int) elif symbol.const_double is not None: @@ -765,7 +757,7 @@ raise ValueError.""" def _create_typedef_struct(self, symbol, disguised=False): try: name = self.strip_identifier(symbol.ident) - except TransformerException, e: + except TransformerException as e: message.warn_symbol(symbol, e) return None struct = ast.Record(name, symbol.ident, disguised=disguised) @@ -777,7 +769,7 @@ raise ValueError.""" def _create_typedef_union(self, symbol): try: name = self.strip_identifier(symbol.ident) - except TransformerException, e: + except TransformerException as e: message.warn(e) return None union = ast.Union(name, symbol.ident) @@ -825,7 +817,7 @@ raise ValueError.""" else: try: name = self.strip_identifier(symbol.ident) - except TransformerException, e: + except TransformerException as e: message.warn(e) return None compound = klass(name, symbol.ident) @@ -846,8 +838,7 @@ raise ValueError.""" # Mark the 'user_data' arguments for i, param in enumerate(parameters): - if (param.type.target_fundamental == 'gpointer' and - param.argname == 'user_data'): + if (param.type.target_fundamental == 'gpointer' and param.argname == 'user_data'): param.closure_name = param.argname if member: @@ -855,13 +846,13 @@ raise ValueError.""" elif symbol.ident.find('_') > 0: try: name = self._strip_symbol(symbol) - except TransformerException, e: + except TransformerException as e: message.warn_symbol(symbol, e) return None else: try: name = self.strip_identifier(symbol.ident) - except TransformerException, e: + except TransformerException as e: message.warn(e) return None callback = ast.Callback(name, retval, parameters, False, diff --git a/giscanner/utils.py b/giscanner/utils.py index 9adf6d9..77d05b9 100644 --- a/giscanner/utils.py +++ b/giscanner/utils.py @@ -22,7 +22,10 @@ import re import os import subprocess + _debugflags = None + + def have_debug_flag(flag): """Check for whether a specific debugging feature is enabled. Well-known flags: @@ -38,6 +41,7 @@ Well-known flags: _debugflags.remove('') return flag in _debugflags + def break_on_debug_flag(flag): if have_debug_flag(flag): import pdb @@ -69,8 +73,10 @@ def to_underscores_noprefix(name): name = _upperstr_pat2.sub(r'\1_\2', name) return name + _libtool_pat = re.compile("dlname='([A-z0-9\.\-\+]+)'\n") + def _extract_dlname_field(la_file): f = open(la_file) data = f.read() @@ -81,6 +87,7 @@ def _extract_dlname_field(la_file): else: return None + # Returns the name that we would pass to dlopen() the library # corresponding to this .la file def extract_libtool_shlib(la_file): @@ -92,6 +99,7 @@ def extract_libtool_shlib(la_file): # a path rather than the raw dlname return os.path.basename(dlname) + def extract_libtool(la_file): dlname = _extract_dlname_field(la_file) if dlname is None: @@ -104,6 +112,7 @@ def extract_libtool(la_file): libname = libname.replace('.libs/.libs', '.libs') return libname + # Returns arguments for invoking libtool, if applicable, otherwise None def get_libtool_command(options): libtool_infection = not options.nolibtool diff --git a/giscanner/xmlwriter.py b/giscanner/xmlwriter.py index 11f8485..6efe684 100755 --- a/giscanner/xmlwriter.py +++ b/giscanner/xmlwriter.py @@ -44,8 +44,7 @@ def _calc_attrs_length(attributes, indent, self_indent): return attr_length + indent + self_indent -def collect_attributes(tag_name, attributes, self_indent, - self_indent_char, indent=-1): +def collect_attributes(tag_name, attributes, self_indent, self_indent_char, indent=-1): if not attributes: return '' if _calc_attrs_length(attributes, indent, self_indent) > 79: @@ -68,6 +67,7 @@ def collect_attributes(tag_name, attributes, self_indent, first = False return attr_value + def build_xml_tag(tag_name, attributes=None, data=None, self_indent=0, self_indent_char=' '): if attributes is None: @@ -86,6 +86,7 @@ def build_xml_tag(tag_name, attributes=None, data=None, self_indent=0, len(prefix) + len(suffix)) return prefix + attrs + suffix + with LibtoolImporter(None, None): if 'UNINSTALLED_INTROSPECTION_SRCDIR' in os.environ: from _giscanner import collect_attributes @@ -108,10 +109,8 @@ class XMLWriter(object): def _open_tag(self, tag_name, attributes=None): if attributes is None: attributes = [] - attrs = collect_attributes( - tag_name, attributes, self._indent, - self._indent_char, - len(tag_name) + 2) + attrs = collect_attributes(tag_name, attributes, + self._indent, self._indent_char, len(tag_name) + 2) self.write_line(u'<%s%s>' % (tag_name, attrs)) def _close_tag(self, tag_name): @@ -135,12 +134,11 @@ class XMLWriter(object): line = line.decode('utf-8') assert isinstance(line, unicode) if do_escape: - line = escape(line.encode('utf-8')).decode('utf-8') + line = escape(line) if indent: - self._data.write('%s%s%s' % ( - self._indent_char * self._indent, - line.encode('utf-8'), - self._newline_char)) + self._data.write('%s%s%s' % (self._indent_char * self._indent, + line.encode('utf-8'), + self._newline_char)) else: self._data.write('%s%s' % (line.encode('utf-8'), self._newline_char)) diff --git a/gobject-introspection-1.0.pc b/gobject-introspection-1.0.pc index 8d27f36..6a8263d 100644 --- a/gobject-introspection-1.0.pc +++ b/gobject-introspection-1.0.pc @@ -1,6 +1,6 @@ -prefix=/usr/local +prefix=/src/build/jhbuild exec_prefix=${prefix} -libdir=${exec_prefix}/lib +libdir=/src/build/jhbuild/lib64 bindir=${exec_prefix}/bin datarootdir=${prefix}/share datadir=${datarootdir} @@ -21,4 +21,4 @@ Libs.private: Name: gobject-introspection Description: GObject Introspection -Version: 1.36.0 +Version: 1.37.1 diff --git a/gobject-introspection-no-export-1.0.pc b/gobject-introspection-no-export-1.0.pc index e5b8548..ed8cd55 100644 --- a/gobject-introspection-no-export-1.0.pc +++ b/gobject-introspection-no-export-1.0.pc @@ -1,6 +1,6 @@ -prefix=/usr/local +prefix=/src/build/jhbuild exec_prefix=${prefix} -libdir=${exec_prefix}/lib +libdir=/src/build/jhbuild/lib64 bindir=${exec_prefix}/bin datarootdir=${prefix}/share datadir=${datarootdir} @@ -20,4 +20,4 @@ Libs.private: Name: gobject-introspection Description: GObject Introspection -Version: 1.36.0 +Version: 1.37.1 diff --git a/m4/python.m4 b/m4/python.m4 index cdd586c..ed5559d 100644 --- a/m4/python.m4 +++ b/m4/python.m4 @@ -63,7 +63,7 @@ AC_DEFUN([AM_CHECK_PYTHON_LIBS], [AC_REQUIRE([AM_CHECK_PYTHON_HEADERS]) AC_MSG_CHECKING(for libraries required to link against libpython) dnl deduce PYTHON_LIBS -if test "x$PYTHON_LIBS" == x; then +if test "x$PYTHON_LIBS" = x; then PYTHON_LIBS=`$PYTHON-config --ldflags --libs` fi AC_SUBST(PYTHON_LIBS) diff --git a/misc/pep8.py b/misc/pep8.py index 3890629..f99ae3a 100644 --- a/misc/pep8.py +++ b/misc/pep8.py @@ -1,6 +1,7 @@ -#!/usr/bin/python +#!/usr/bin/env python # pep8.py - Check Python source code formatting, according to PEP 8 -# Copyright (C) 2006 Johann C. Rocholl +# Copyright (C) 2006-2009 Johann C. Rocholl +# Copyright (C) 2009-2013 Florent Xicluna # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files @@ -22,7 +23,7 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -""" +r""" Check Python source code formatting, according to PEP 8: http://www.python.org/dev/peps/pep-0008/ @@ -30,8 +31,7 @@ For usage and a list of options, try this: $ python pep8.py -h This program and its regression test suite live here: -http://svn.browsershots.org/trunk/devtools/pep8/ -http://trac.browsershots.org/browser/trunk/devtools/pep8/ +http://github.com/jcrocholl/pep8 Groups of errors and warnings: E errors @@ -43,72 +43,72 @@ W warnings 500 line length 600 deprecation 700 statements - -You can add checks to this program by writing plugins. Each plugin is -a simple function that is called for each line of source code, either -physical or logical. - -Physical line: -- Raw line of text from the input file. - -Logical line: -- Multi-line statements converted to a single line. -- Stripped left and right. -- Contents of strings replaced with 'xxx' of same length. -- Comments removed. - -The check function requests physical or logical lines by the name of -the first argument: - -def maximum_line_length(physical_line) -def extraneous_whitespace(logical_line) -def blank_lines(logical_line, blank_lines, indent_level, line_number) - -The last example above demonstrates how check plugins can request -additional information with extra arguments. All attributes of the -Checker object are available. Some examples: - -lines: a list of the raw lines from the input file -tokens: the tokens that contribute to this logical line -line_number: line number in the input file -blank_lines: blank lines before this one -indent_char: first indentation character in this file (' ' or '\t') -indent_level: indentation (with tabs expanded to multiples of 8) -previous_indent_level: indentation on previous line -previous_logical: previous logical line - -The docstring of each check function shall be the relevant part of -text from PEP 8. It is printed if the user enables --show-pep8. - +900 syntax error """ +__version__ = '1.4.5' import os import sys import re import time import inspect +import keyword import tokenize from optparse import OptionParser -from keyword import iskeyword from fnmatch import fnmatch - -__version__ = '0.2.0' -__revision__ = '$Rev$' - -default_exclude = '.svn,CVS,*.pyc,*.pyo' - -indent_match = re.compile(r'([ \t]*)').match -raise_comma_match = re.compile(r'raise\s+\w+\s*(,)').match - -operators = """ -+ - * / % ^ & | = < > >> << -+= -= *= /= %= ^= &= |= == <= >= >>= <<= -!= <> : -in is or not and -""".split() - -options = None -args = None +try: + from configparser import RawConfigParser + from io import TextIOWrapper +except ImportError: + from ConfigParser import RawConfigParser + +DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git,__pycache__' +DEFAULT_IGNORE = 'E226,E24' +if sys.platform == 'win32': + DEFAULT_CONFIG = os.path.expanduser(r'~\.pep8') +else: + DEFAULT_CONFIG = os.path.join(os.getenv('XDG_CONFIG_HOME') or + os.path.expanduser('~/.config'), 'pep8') +PROJECT_CONFIG = ('.pep8', 'tox.ini', 'setup.cfg') +TESTSUITE_PATH = os.path.join(os.path.dirname(__file__), 'testsuite') +MAX_LINE_LENGTH = 79 +REPORT_FORMAT = { + 'default': '%(path)s:%(row)d:%(col)d: %(code)s %(text)s', + 'pylint': '%(path)s:%(row)d: [%(code)s] %(text)s', +} + +PyCF_ONLY_AST = 1024 +SINGLETONS = frozenset(['False', 'None', 'True']) +KEYWORDS = frozenset(keyword.kwlist + ['print']) - SINGLETONS +UNARY_OPERATORS = frozenset(['>>', '**', '*', '+', '-']) +ARITHMETIC_OP = frozenset(['**', '*', '/', '//', '+', '-']) +WS_OPTIONAL_OPERATORS = ARITHMETIC_OP.union(['^', '&', '|', '<<', '>>', '%']) +WS_NEEDED_OPERATORS = frozenset([ + '**=', '*=', '/=', '//=', '+=', '-=', '!=', '<>', '<', '>', + '%=', '^=', '&=', '|=', '==', '<=', '>=', '<<=', '>>=', '=']) +WHITESPACE = frozenset(' \t') +SKIP_TOKENS = frozenset([tokenize.COMMENT, tokenize.NL, tokenize.NEWLINE, + tokenize.INDENT, tokenize.DEDENT]) +BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines'] + +INDENT_REGEX = re.compile(r'([ \t]*)') +RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,') +RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,\s*\w+\s*,\s*\w+') +ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b') +DOCSTRING_REGEX = re.compile(r'u?r?["\']') +EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]') +WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)') +COMPARE_SINGLETON_REGEX = re.compile(r'([=!]=)\s*(None|False|True)') +COMPARE_TYPE_REGEX = re.compile(r'(?:[=!]=|is(?:\s+not)?)\s*type(?:s.\w+Type' + r'|\s*\(\s*([^)]*[^ )])\s*\))') +KEYWORD_REGEX = re.compile(r'(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS)) +OPERATOR_REGEX = re.compile(r'(?:[^,\s])(\s*)(?:[-+*/|!<=>%&^]+)(\s*)') +LAMBDA_REGEX = re.compile(r'\blambda\b') +HUNK_REGEX = re.compile(r'^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@.*$') + +# Work around Python < 2.6 behaviour, which does not generate NL after +# a comment which is on a line by itself. +COMMENT_WITH_NL = tokenize.generate_tokens(['#\n'].pop).send(None)[1] == '#\n' ############################################################################## @@ -117,7 +117,7 @@ args = None def tabs_or_spaces(physical_line, indent_char): - """ + r""" Never mix tabs and spaces. The most popular way of indenting Python is with spaces only. The @@ -126,52 +126,81 @@ def tabs_or_spaces(physical_line, indent_char): invoking the Python command line interpreter with the -t option, it issues warnings about code that illegally mixes tabs and spaces. When using -tt these warnings become errors. These options are highly recommended! + + Okay: if a == 0:\n a = 1\n b = 1 + E101: if a == 0:\n a = 1\n\tb = 1 """ - indent = indent_match(physical_line).group(1) + indent = INDENT_REGEX.match(physical_line).group(1) for offset, char in enumerate(indent): if char != indent_char: return offset, "E101 indentation contains mixed spaces and tabs" def tabs_obsolete(physical_line): - """ + r""" For new projects, spaces-only are strongly recommended over tabs. Most editors have features that make this easy to do. + + Okay: if True:\n return + W191: if True:\n\treturn """ - indent = indent_match(physical_line).group(1) - if indent.count('\t'): + indent = INDENT_REGEX.match(physical_line).group(1) + if '\t' in indent: return indent.index('\t'), "W191 indentation contains tabs" def trailing_whitespace(physical_line): - """ + r""" JCR: Trailing whitespace is superfluous. + FBM: Except when it occurs as part of a blank line (i.e. the line is + nothing but whitespace). According to Python docs[1] a line with only + whitespace is considered a blank line, and is to be ignored. However, + matching a blank line to its indentation level avoids mistakenly + terminating a multi-line statement (e.g. class declaration) when + pasting code into the standard Python interpreter. + + [1] http://docs.python.org/reference/lexical_analysis.html#blank-lines + + The warning returned varies on whether the line itself is blank, for easier + filtering for those who want to indent their blank lines. + + Okay: spam(1)\n# + W291: spam(1) \n# + W293: class Foo(object):\n \n bang = 12 """ - physical_line = physical_line.rstrip('\n') # chr(10), newline - physical_line = physical_line.rstrip('\r') # chr(13), carriage return - physical_line = physical_line.rstrip('\x0c') # chr(12), form feed, ^L - stripped = physical_line.rstrip() + physical_line = physical_line.rstrip('\n') # chr(10), newline + physical_line = physical_line.rstrip('\r') # chr(13), carriage return + physical_line = physical_line.rstrip('\x0c') # chr(12), form feed, ^L + stripped = physical_line.rstrip(' \t\v') if physical_line != stripped: - return len(stripped), "W291 trailing whitespace" + if stripped: + return len(stripped), "W291 trailing whitespace" + else: + return 0, "W293 blank line contains whitespace" def trailing_blank_lines(physical_line, lines, line_number): - """ + r""" JCR: Trailing blank lines are superfluous. + + Okay: spam(1) + W391: spam(1)\n """ - if physical_line.strip() == '' and line_number == len(lines): + if not physical_line.rstrip() and line_number == len(lines): return 0, "W391 blank line at end of file" def missing_newline(physical_line): """ JCR: The last line should have a newline. + + Reports warning W292. """ if physical_line.rstrip() == physical_line: return len(physical_line), "W292 no newline at end of file" -def maximum_line_length(physical_line): +def maximum_line_length(physical_line, max_line_length): """ Limit all lines to a maximum of 79 characters. @@ -181,10 +210,23 @@ def maximum_line_length(physical_line): ugly. Therefore, please limit all lines to a maximum of 79 characters. For flowing long blocks of text (docstrings or comments), limiting the length to 72 characters is recommended. + + Reports error E501. """ - length = len(physical_line.rstrip()) - if length > 99: - return 79, "E501 line too long (%d characters)" % length + line = physical_line.rstrip() + length = len(line) + if length > max_line_length: + if noqa(line): + return + if hasattr(line, 'decode'): # Python 2 + # The line could contain multi-byte characters + try: + length = len(line.decode('utf-8')) + except UnicodeError: + pass + if length > max_line_length: + return (max_line_length, "E501 line too long " + "(%d > %d characters)" % (length, max_line_length)) ############################################################################## @@ -192,6 +234,44 @@ def maximum_line_length(physical_line): ############################################################################## +def blank_lines(logical_line, blank_lines, indent_level, line_number, + previous_logical, previous_indent_level): + r""" + Separate top-level function and class definitions with two blank lines. + + Method definitions inside a class are separated by a single blank line. + + Extra blank lines may be used (sparingly) to separate groups of related + functions. Blank lines may be omitted between a bunch of related + one-liners (e.g. a set of dummy implementations). + + Use blank lines in functions, sparingly, to indicate logical sections. + + Okay: def a():\n pass\n\n\ndef b():\n pass + Okay: def a():\n pass\n\n\n# Foo\n# Bar\n\ndef b():\n pass + + E301: class Foo:\n b = 0\n def bar():\n pass + E302: def a():\n pass\n\ndef b(n):\n pass + E303: def a():\n pass\n\n\n\ndef b(n):\n pass + E303: def a():\n\n\n\n pass + E304: @decorator\n\ndef a():\n pass + """ + if line_number < 3 and not previous_logical: + return # Don't expect blank lines before the first line + if previous_logical.startswith('@'): + if blank_lines: + yield 0, "E304 blank lines found after function decorator" + elif blank_lines > 2 or (indent_level and blank_lines == 2): + yield 0, "E303 too many blank lines (%d)" % blank_lines + elif logical_line.startswith(('def ', 'class ', '@')): + if indent_level: + if not (blank_lines or previous_indent_level < indent_level or + DOCSTRING_REGEX.match(previous_logical)): + yield 0, "E301 expected 1 blank line, found 0" + elif blank_lines != 2: + yield 0, "E302 expected 2 blank lines, found %d" % blank_lines + + def extraneous_whitespace(logical_line): """ Avoid extraneous whitespace in the following situations: @@ -199,51 +279,273 @@ def extraneous_whitespace(logical_line): - Immediately inside parentheses, brackets or braces. - Immediately before a comma, semicolon, or colon. + + Okay: spam(ham[1], {eggs: 2}) + E201: spam( ham[1], {eggs: 2}) + E201: spam(ham[ 1], {eggs: 2}) + E201: spam(ham[1], { eggs: 2}) + E202: spam(ham[1], {eggs: 2} ) + E202: spam(ham[1 ], {eggs: 2}) + E202: spam(ham[1], {eggs: 2 }) + + E203: if x == 4: print x, y; x, y = y , x + E203: if x == 4: print x, y ; x, y = y, x + E203: if x == 4 : print x, y; x, y = y, x """ line = logical_line - for char in '([{': - found = line.find(char + ' ') - if found > -1: - return found + 1, "E201 whitespace after '%s'" % char - for char in '}])': - found = line.find(' ' + char) - if found > -1 and line[found - 1] != ',': - return found, "E202 whitespace before '%s'" % char - for char in ',;:': - found = line.find(' ' + char) - if found > -1: - return found, "E203 whitespace before '%s'" % char + for match in EXTRANEOUS_WHITESPACE_REGEX.finditer(line): + text = match.group() + char = text.strip() + found = match.start() + if text == char + ' ': + # assert char in '([{' + yield found + 1, "E201 whitespace after '%s'" % char + elif line[found - 1] != ',': + code = ('E202' if char in '}])' else 'E203') # if char in ',;:' + yield found, "%s whitespace before '%s'" % (code, char) + + +def whitespace_around_keywords(logical_line): + r""" + Avoid extraneous whitespace around keywords. + + Okay: True and False + E271: True and False + E272: True and False + E273: True and\tFalse + E274: True\tand False + """ + for match in KEYWORD_REGEX.finditer(logical_line): + before, after = match.groups() + + if '\t' in before: + yield match.start(1), "E274 tab before keyword" + elif len(before) > 1: + yield match.start(1), "E272 multiple spaces before keyword" + + if '\t' in after: + yield match.start(2), "E273 tab after keyword" + elif len(after) > 1: + yield match.start(2), "E271 multiple spaces after keyword" def missing_whitespace(logical_line): """ JCR: Each comma, semicolon or colon should be followed by whitespace. + + Okay: [a, b] + Okay: (3,) + Okay: a[1:4] + Okay: a[:4] + Okay: a[1:] + Okay: a[1:4:2] + E231: ['a','b'] + E231: foo(bar,baz) + E231: [{'a':'b'}] """ line = logical_line for index in range(len(line) - 1): char = line[index] - if char in ',;:' and line[index + 1] != ' ': + if char in ',;:' and line[index + 1] not in WHITESPACE: before = line[:index] - if char == ':' and before.count('[') > before.count(']'): - continue # Slice syntax, no space required - return index, "E231 missing whitespace after '%s'" % char + if char == ':' and before.count('[') > before.count(']') and \ + before.rfind('{') < before.rfind('['): + continue # Slice syntax, no space required + if char == ',' and line[index + 1] == ')': + continue # Allow tuple with only one element: (3,) + yield index, "E231 missing whitespace after '%s'" % char def indentation(logical_line, previous_logical, indent_char, indent_level, previous_indent_level): - """ + r""" Use 4 spaces per indentation level. For really old code that you don't want to mess up, you can continue to use 8-space tabs. + + Okay: a = 1 + Okay: if a == 0:\n a = 1 + E111: a = 1 + + Okay: for item in items:\n pass + E112: for item in items:\npass + + Okay: a = 1\nb = 2 + E113: a = 1\n b = 2 """ if indent_char == ' ' and indent_level % 4: - return 0, "E111 indentation is not a multiple of four" + yield 0, "E111 indentation is not a multiple of four" indent_expect = previous_logical.endswith(':') if indent_expect and indent_level <= previous_indent_level: - return 0, "E112 expected an indented block" + yield 0, "E112 expected an indented block" if indent_level > previous_indent_level and not indent_expect: - return 0, "E113 unexpected indentation" + yield 0, "E113 unexpected indentation" + + +def continuation_line_indentation(logical_line, tokens, indent_level, verbose): + r""" + Continuation lines should align wrapped elements either vertically using + Python's implicit line joining inside parentheses, brackets and braces, or + using a hanging indent. + + When using a hanging indent the following considerations should be applied: + + - there should be no arguments on the first line, and + + - further indentation should be used to clearly distinguish itself as a + continuation line. + + Okay: a = (\n) + E123: a = (\n ) + + Okay: a = (\n 42) + E121: a = (\n 42) + E122: a = (\n42) + E123: a = (\n 42\n ) + E124: a = (24,\n 42\n) + E125: if (a or\n b):\n pass + E126: a = (\n 42) + E127: a = (24,\n 42) + E128: a = (24,\n 42) + """ + first_row = tokens[0][2][0] + nrows = 1 + tokens[-1][2][0] - first_row + if nrows == 1 or noqa(tokens[0][4]): + return + + # indent_next tells us whether the next block is indented; assuming + # that it is indented by 4 spaces, then we should not allow 4-space + # indents on the final continuation line; in turn, some other + # indents are allowed to have an extra 4 spaces. + indent_next = logical_line.endswith(':') + + row = depth = 0 + # remember how many brackets were opened on each line + parens = [0] * nrows + # relative indents of physical lines + rel_indent = [0] * nrows + # visual indents + indent_chances = {} + last_indent = tokens[0][2] + indent = [last_indent[1]] + if verbose >= 3: + print(">>> " + tokens[0][4].rstrip()) + + for token_type, text, start, end, line in tokens: + + newline = row < start[0] - first_row + if newline: + row = start[0] - first_row + newline = (not last_token_multiline and + token_type not in (tokenize.NL, tokenize.NEWLINE)) + + if newline: + # this is the beginning of a continuation line. + last_indent = start + if verbose >= 3: + print("... " + line.rstrip()) + + # record the initial indent. + rel_indent[row] = expand_indent(line) - indent_level + + if depth: + # a bracket expression in a continuation line. + # find the line that it was opened on + for open_row in range(row - 1, -1, -1): + if parens[open_row]: + break + else: + # an unbracketed continuation line (ie, backslash) + open_row = 0 + hang = rel_indent[row] - rel_indent[open_row] + visual_indent = indent_chances.get(start[1]) + + if token_type == tokenize.OP and text in ']})': + # this line starts with a closing bracket + if indent[depth]: + if start[1] != indent[depth]: + yield (start, "E124 closing bracket does not match " + "visual indentation") + elif hang: + yield (start, "E123 closing bracket does not match " + "indentation of opening bracket's line") + elif visual_indent is True: + # visual indent is verified + if not indent[depth]: + indent[depth] = start[1] + elif visual_indent in (text, str): + # ignore token lined up with matching one from a previous line + pass + elif indent[depth] and start[1] < indent[depth]: + # visual indent is broken + yield (start, "E128 continuation line " + "under-indented for visual indent") + elif hang == 4 or (indent_next and rel_indent[row] == 8): + # hanging indent is verified + pass + else: + # indent is broken + if hang <= 0: + error = "E122", "missing indentation or outdented" + elif indent[depth]: + error = "E127", "over-indented for visual indent" + elif hang % 4: + error = "E121", "indentation is not a multiple of four" + else: + error = "E126", "over-indented for hanging indent" + yield start, "%s continuation line %s" % error + + # look for visual indenting + if (parens[row] and token_type not in (tokenize.NL, tokenize.COMMENT) + and not indent[depth]): + indent[depth] = start[1] + indent_chances[start[1]] = True + if verbose >= 4: + print("bracket depth %s indent to %s" % (depth, start[1])) + # deal with implicit string concatenation + elif (token_type in (tokenize.STRING, tokenize.COMMENT) or + text in ('u', 'ur', 'b', 'br')): + indent_chances[start[1]] = str + # special case for the "if" statement because len("if (") == 4 + elif not indent_chances and not row and not depth and text == 'if': + indent_chances[end[1] + 1] = True + + # keep track of bracket depth + if token_type == tokenize.OP: + if text in '([{': + depth += 1 + indent.append(0) + parens[row] += 1 + if verbose >= 4: + print("bracket depth %s seen, col %s, visual min = %s" % + (depth, start[1], indent[depth])) + elif text in ')]}' and depth > 0: + # parent indents should not be more than this one + prev_indent = indent.pop() or last_indent[1] + for d in range(depth): + if indent[d] > prev_indent: + indent[d] = 0 + for ind in list(indent_chances): + if ind >= prev_indent: + del indent_chances[ind] + depth -= 1 + if depth: + indent_chances[indent[depth]] = True + for idx in range(row, -1, -1): + if parens[idx]: + parens[idx] -= 1 + break + assert len(indent) == depth + 1 + if start[1] not in indent_chances: + # allow to line up tokens + indent_chances[start[1]] = text + + last_token_multiline = (start[0] != end[0]) + + if indent_next and rel_indent[-1] == 4: + yield (last_indent, "E125 continuation line does not distinguish " + "itself from next logical line") def whitespace_before_parameters(logical_line, tokens): @@ -255,6 +557,13 @@ def whitespace_before_parameters(logical_line, tokens): - Immediately before the open parenthesis that starts an indexing or slicing. + + Okay: spam(1) + E211: spam (1) + + Okay: dict['key'] = list[index] + E211: dict ['key'] = list[index] + E211: dict['key'] = list [index] """ prev_type = tokens[0][0] prev_text = tokens[0][1] @@ -264,97 +573,391 @@ def whitespace_before_parameters(logical_line, tokens): if (token_type == tokenize.OP and text in '([' and start != prev_end and - prev_type == tokenize.NAME and + (prev_type == tokenize.NAME or prev_text in '}])') and + # Syntax "class A (B):" is allowed, but avoid it (index < 2 or tokens[index - 2][1] != 'class') and - (not iskeyword(prev_text))): - return prev_end, "E211 whitespace before '%s'" % text + # Allow "return (a.foo for a in range(5))" + not keyword.iskeyword(prev_text)): + yield prev_end, "E211 whitespace before '%s'" % text prev_type = token_type prev_text = text prev_end = end def whitespace_around_operator(logical_line): - """ + r""" Avoid extraneous whitespace in the following situations: - More than one space around an assignment (or other) operator to align it with another. + + Okay: a = 12 + 3 + E221: a = 4 + 5 + E222: a = 4 + 5 + E223: a = 4\t+ 5 + E224: a = 4 +\t5 """ - line = logical_line - for operator in operators: - found = line.find(' ' + operator) - if found > -1: - return found, "E221 multiple spaces before operator" - found = line.find(operator + ' ') - if found > -1: - return found, "E222 multiple spaces after operator" - found = line.find('\t' + operator) - if found > -1: - return found, "E223 tab before operator" - found = line.find(operator + '\t') - if found > -1: - return found, "E224 tab after operator" + for match in OPERATOR_REGEX.finditer(logical_line): + before, after = match.groups() + + if '\t' in before: + yield match.start(1), "E223 tab before operator" + elif len(before) > 1: + yield match.start(1), "E221 multiple spaces before operator" + + if '\t' in after: + yield match.start(2), "E224 tab after operator" + elif len(after) > 1: + yield match.start(2), "E222 multiple spaces after operator" + + +def missing_whitespace_around_operator(logical_line, tokens): + r""" + - Always surround these binary operators with a single space on + either side: assignment (=), augmented assignment (+=, -= etc.), + comparisons (==, <, >, !=, <>, <=, >=, in, not in, is, is not), + Booleans (and, or, not). + + - Use spaces around arithmetic operators. + + Okay: i = i + 1 + Okay: submitted += 1 + Okay: x = x * 2 - 1 + Okay: hypot2 = x * x + y * y + Okay: c = (a + b) * (a - b) + Okay: foo(bar, key='word', *args, **kwargs) + Okay: alpha[:-i] + + E225: i=i+1 + E225: submitted +=1 + E225: x = x /2 - 1 + E225: z = x **y + E226: c = (a+b) * (a-b) + E226: hypot2 = x*x + y*y + E227: c = a|b + E228: msg = fmt%(errno, errmsg) + """ + parens = 0 + need_space = False + prev_type = tokenize.OP + prev_text = prev_end = None + for token_type, text, start, end, line in tokens: + if token_type in (tokenize.NL, tokenize.NEWLINE, tokenize.ERRORTOKEN): + # ERRORTOKEN is triggered by backticks in Python 3 + continue + if text in ('(', 'lambda'): + parens += 1 + elif text == ')': + parens -= 1 + if need_space: + if start != prev_end: + # Found a (probably) needed space + if need_space is not True and not need_space[1]: + yield (need_space[0], + "E225 missing whitespace around operator") + need_space = False + elif text == '>' and prev_text in ('<', '-'): + # Tolerate the "<>" operator, even if running Python 3 + # Deal with Python 3's annotated return value "->" + pass + else: + if need_space is True or need_space[1]: + # A needed trailing space was not found + yield prev_end, "E225 missing whitespace around operator" + else: + code, optype = 'E226', 'arithmetic' + if prev_text == '%': + code, optype = 'E228', 'modulo' + elif prev_text not in ARITHMETIC_OP: + code, optype = 'E227', 'bitwise or shift' + yield (need_space[0], "%s missing whitespace " + "around %s operator" % (code, optype)) + need_space = False + elif token_type == tokenize.OP and prev_end is not None: + if text == '=' and parens: + # Allow keyword args or defaults: foo(bar=None). + pass + elif text in WS_NEEDED_OPERATORS: + need_space = True + elif text in UNARY_OPERATORS: + # Check if the operator is being used as a binary operator + # Allow unary operators: -123, -x, +1. + # Allow argument unpacking: foo(*args, **kwargs). + if prev_type == tokenize.OP: + binary_usage = (prev_text in '}])') + elif prev_type == tokenize.NAME: + binary_usage = (prev_text not in KEYWORDS) + else: + binary_usage = (prev_type not in SKIP_TOKENS) + + if binary_usage: + need_space = None + elif text in WS_OPTIONAL_OPERATORS: + need_space = None + + if need_space is None: + # Surrounding space is optional, but ensure that + # trailing space matches opening space + need_space = (prev_end, start != prev_end) + elif need_space and start == prev_end: + # A needed opening space was not found + yield prev_end, "E225 missing whitespace around operator" + need_space = False + prev_type = token_type + prev_text = text + prev_end = end def whitespace_around_comma(logical_line): - """ + r""" Avoid extraneous whitespace in the following situations: - More than one space around an assignment (or other) operator to align it with another. - JCR: This should also be applied around comma etc. + Note: these checks are disabled by default + + Okay: a = (1, 2) + E241: a = (1, 2) + E242: a = (1,\t2) """ line = logical_line - for separator in ',;:': - found = line.find(separator + ' ') - if found > -1: - return found + 1, "E241 multiple spaces after '%s'" % separator - found = line.find(separator + '\t') - if found > -1: - return found + 1, "E242 tab after '%s'" % separator + for m in WHITESPACE_AFTER_COMMA_REGEX.finditer(line): + found = m.start() + 1 + if '\t' in m.group(): + yield found, "E242 tab after '%s'" % m.group()[0] + else: + yield found, "E241 multiple spaces after '%s'" % m.group()[0] -def imports_on_separate_lines(logical_line): +def whitespace_around_named_parameter_equals(logical_line, tokens): + """ + Don't use spaces around the '=' sign when used to indicate a + keyword argument or a default parameter value. + + Okay: def complex(real, imag=0.0): + Okay: return magic(r=real, i=imag) + Okay: boolean(a == b) + Okay: boolean(a != b) + Okay: boolean(a <= b) + Okay: boolean(a >= b) + + E251: def complex(real, imag = 0.0): + E251: return magic(r = real, i = imag) + """ + parens = 0 + no_space = False + prev_end = None + message = "E251 unexpected spaces around keyword / parameter equals" + for token_type, text, start, end, line in tokens: + if no_space: + no_space = False + if start != prev_end: + yield (prev_end, message) + elif token_type == tokenize.OP: + if text == '(': + parens += 1 + elif text == ')': + parens -= 1 + elif parens and text == '=': + no_space = True + if start != prev_end: + yield (prev_end, message) + prev_end = end + + +def whitespace_before_inline_comment(logical_line, tokens): + """ + Separate inline comments by at least two spaces. + + An inline comment is a comment on the same line as a statement. Inline + comments should be separated by at least two spaces from the statement. + They should start with a # and a single space. + + Okay: x = x + 1 # Increment x + Okay: x = x + 1 # Increment x + E261: x = x + 1 # Increment x + E262: x = x + 1 #Increment x + E262: x = x + 1 # Increment x """ + prev_end = (0, 0) + for token_type, text, start, end, line in tokens: + if token_type == tokenize.COMMENT: + if not line[:start[1]].strip(): + continue + if prev_end[0] == start[0] and start[1] < prev_end[1] + 2: + yield (prev_end, + "E261 at least two spaces before inline comment") + symbol, sp, comment = text.partition(' ') + if symbol not in ('#', '#:') or comment[:1].isspace(): + yield start, "E262 inline comment should start with '# '" + elif token_type != tokenize.NL: + prev_end = end + + +def imports_on_separate_lines(logical_line): + r""" Imports should usually be on separate lines. + + Okay: import os\nimport sys + E401: import sys, os + + Okay: from subprocess import Popen, PIPE + Okay: from myclas import MyClass + Okay: from foo.bar.yourclass import YourClass + Okay: import myclass + Okay: import foo.bar.yourclass """ line = logical_line if line.startswith('import '): found = line.find(',') - if found > -1: - return found, "E401 multiple imports on one line" + if -1 < found and ';' not in line[:found]: + yield found, "E401 multiple imports on one line" def compound_statements(logical_line): - """ + r""" Compound statements (multiple statements on the same line) are generally discouraged. + + While sometimes it's okay to put an if/for/while with a small body + on the same line, never do this for multi-clause statements. Also + avoid folding such long lines! + + Okay: if foo == 'blah':\n do_blah_thing() + Okay: do_one() + Okay: do_two() + Okay: do_three() + + E701: if foo == 'blah': do_blah_thing() + E701: for x in lst: total += x + E701: while t < 10: t = delay() + E701: if foo == 'blah': do_blah_thing() + E701: else: do_non_blah_thing() + E701: try: something() + E701: finally: cleanup() + E701: if foo == 'blah': one(); two(); three() + + E702: do_one(); do_two(); do_three() + E703: do_four(); # useless semicolon """ line = logical_line + last_char = len(line) - 1 found = line.find(':') - if -1 < found < len(line) - 1: + if -1 < found < last_char: before = line[:found] - if (before.count('{') <= before.count('}') and # {'a': 1} (dict) - before.count('[') <= before.count(']') and # [1:2] (slice) - not re.search(r'\blambda\b', before)): # lambda x: x - return found, "E701 multiple statements on one line (colon)" + if (before.count('{') <= before.count('}') and # {'a': 1} (dict) + before.count('[') <= before.count(']') and # [1:2] (slice) + before.count('(') <= before.count(')') and # (Python 3 annotation) + not LAMBDA_REGEX.search(before)): # lambda x: x + yield found, "E701 multiple statements on one line (colon)" found = line.find(';') if -1 < found: - return found, "E702 multiple statements on one line (semicolon)" + if found < last_char: + yield found, "E702 multiple statements on one line (semicolon)" + else: + yield found, "E703 statement ends with a semicolon" -def python_3000_has_key(logical_line): +def explicit_line_join(logical_line, tokens): + r""" + Avoid explicit line join between brackets. + + The preferred way of wrapping long lines is by using Python's implied line + continuation inside parentheses, brackets and braces. Long lines can be + broken over multiple lines by wrapping expressions in parentheses. These + should be used in preference to using a backslash for line continuation. + + E502: aaa = [123, \\n 123] + E502: aaa = ("bbb " \\n "ccc") + + Okay: aaa = [123,\n 123] + Okay: aaa = ("bbb "\n "ccc") + Okay: aaa = "bbb " \\n "ccc" + """ + prev_start = prev_end = parens = 0 + for token_type, text, start, end, line in tokens: + if start[0] != prev_start and parens and backslash: + yield backslash, "E502 the backslash is redundant between brackets" + if end[0] != prev_end: + if line.rstrip('\r\n').endswith('\\'): + backslash = (end[0], len(line.splitlines()[-1]) - 1) + else: + backslash = None + prev_start = prev_end = end[0] + else: + prev_start = start[0] + if token_type == tokenize.OP: + if text in '([{': + parens += 1 + elif text in ')]}': + parens -= 1 + + +def comparison_to_singleton(logical_line): + """ + Comparisons to singletons like None should always be done + with "is" or "is not", never the equality operators. + + Okay: if arg is not None: + E711: if arg != None: + E712: if arg == True: + + Also, beware of writing if x when you really mean if x is not None -- + e.g. when testing whether a variable or argument that defaults to None was + set to some other value. The other value might have a type (such as a + container) that could be false in a boolean context! + """ + match = COMPARE_SINGLETON_REGEX.search(logical_line) + if match: + same = (match.group(1) == '==') + singleton = match.group(2) + msg = "'if cond is %s:'" % (('' if same else 'not ') + singleton) + if singleton in ('None',): + code = 'E711' + else: + code = 'E712' + nonzero = ((singleton == 'True' and same) or + (singleton == 'False' and not same)) + msg += " or 'if %scond:'" % ('' if nonzero else 'not ') + yield match.start(1), ("%s comparison to %s should be %s" % + (code, singleton, msg)) + + +def comparison_type(logical_line): """ - The {}.has_key() method will be removed in the future version of - Python. Use the 'in' operation instead, like: - d = {"a": 1, "b": 2} - if "b" in d: - print d["b"] + Object type comparisons should always use isinstance() instead of + comparing types directly. + + Okay: if isinstance(obj, int): + E721: if type(obj) is type(1): + + When checking if an object is a string, keep in mind that it might be a + unicode string too! In Python 2.3, str and unicode have a common base + class, basestring, so you can do: + + Okay: if isinstance(obj, basestring): + Okay: if type(a1) is type(b1): + """ + match = COMPARE_TYPE_REGEX.search(logical_line) + if match: + inst = match.group(1) + if inst and isidentifier(inst) and inst not in SINGLETONS: + return # Allow comparison for types which are not obvious + yield match.start(), "E721 do not compare types, use 'isinstance()'" + + +def python_3000_has_key(logical_line): + r""" + The {}.has_key() method is removed in the Python 3. + Use the 'in' operation instead. + + Okay: if "alph" in d:\n print d["alph"] + W601: assert d.has_key('alph') """ pos = logical_line.find('.has_key(') if pos > -1: - return pos, "W601 .has_key() is deprecated, use 'in'" + yield pos, "W601 .has_key() is deprecated, use 'in'" def python_3000_raise_comma(logical_line): @@ -365,11 +968,41 @@ def python_3000_raise_comma(logical_line): The paren-using form is preferred because when the exception arguments are long or include string formatting, you don't need to use line continuation characters thanks to the containing parentheses. The older - form will be removed in Python 3000. + form is removed in Python 3. + + Okay: raise DummyError("Message") + W602: raise DummyError, "Message" """ - match = raise_comma_match(logical_line) - if match: - return match.start(1), "W602 deprecated form of raising exception" + match = RAISE_COMMA_REGEX.match(logical_line) + if match and not RERAISE_COMMA_REGEX.match(logical_line): + yield match.end() - 1, "W602 deprecated form of raising exception" + + +def python_3000_not_equal(logical_line): + """ + != can also be written <>, but this is an obsolete usage kept for + backwards compatibility only. New code should always use !=. + The older syntax is removed in Python 3. + + Okay: if a != 'no': + W603: if a <> 'no': + """ + pos = logical_line.find('<>') + if pos > -1: + yield pos, "W603 '<>' is deprecated, use '!='" + + +def python_3000_backticks(logical_line): + """ + Backticks are removed in Python 3. + Use repr() instead. + + Okay: val = repr(1 + 2) + W604: val = `1 + 2` + """ + pos = logical_line.find('`') + if pos > -1: + yield pos, "W604 backticks are deprecated, use 'repr()'" ############################################################################## @@ -377,26 +1010,63 @@ def python_3000_raise_comma(logical_line): ############################################################################## +if '' == ''.encode(): + # Python 2: implicit encoding. + def readlines(filename): + f = open(filename) + try: + return f.readlines() + finally: + f.close() + + isidentifier = re.compile(r'[a-zA-Z_]\w*').match + stdin_get_value = sys.stdin.read +else: + # Python 3 + def readlines(filename): + f = open(filename, 'rb') + try: + coding, lines = tokenize.detect_encoding(f.readline) + f = TextIOWrapper(f, coding, line_buffering=True) + return [l.decode(coding) for l in lines] + f.readlines() + except (LookupError, SyntaxError, UnicodeError): + f.close() + # Fall back if files are improperly declared + f = open(filename, encoding='latin-1') + return f.readlines() + finally: + f.close() + + isidentifier = str.isidentifier + + def stdin_get_value(): + return TextIOWrapper(sys.stdin.buffer, errors='ignore').read() +readlines.__doc__ = " Read the source code." +noqa = re.compile(r'# no(?:qa|pep8)\b', re.I).search + + def expand_indent(line): - """ + r""" Return the amount of indentation. Tabs are expanded to the next multiple of 8. >>> expand_indent(' ') 4 - >>> expand_indent('\\t') + >>> expand_indent('\t') 8 - >>> expand_indent(' \\t') + >>> expand_indent(' \t') 8 - >>> expand_indent(' \\t') + >>> expand_indent(' \t') 8 - >>> expand_indent(' \\t') + >>> expand_indent(' \t') 16 """ + if '\t' not in line: + return len(line) - len(line.lstrip()) result = 0 for char in line: if char == '\t': - result = result / 8 * 8 + 8 + result = result // 8 * 8 + 8 elif char == ' ': result += 1 else: @@ -404,34 +1074,6 @@ def expand_indent(line): return result -############################################################################## -# Framework to run all checks -############################################################################## - - -def message(text): - """Print a message.""" - # print >> sys.stderr, options.prog + ': ' + text - # print >> sys.stderr, text - print text - - -def find_checks(argument_name): - """ - Find all globally visible functions where the first argument name - starts with argument_name. - """ - checks = [] - function_type = type(find_checks) - for name, function in globals().iteritems(): - if type(function) is function_type: - args = inspect.getargspec(function)[0] - if len(args) >= 1 and args[0].startswith(argument_name): - checks.append((name, function, args)) - checks.sort() - return checks - - def mute_string(text): """ Replace contents with 'xxx' to prevent syntax matching. @@ -443,32 +1085,135 @@ def mute_string(text): >>> mute_string("r'abc'") "r'xxx'" """ - start = 1 - end = len(text) - 1 # String modifiers (e.g. u or r) - if text.endswith('"'): - start += text.index('"') - elif text.endswith("'"): - start += text.index("'") + start = text.index(text[-1]) + 1 + end = len(text) - 1 # Triple quotes - if text.endswith('"""') or text.endswith("'''"): + if text[-3:] in ('"""', "'''"): start += 2 end -= 2 return text[:start] + 'x' * (end - start) + text[end:] -class Checker: +def parse_udiff(diff, patterns=None, parent='.'): + """Return a dictionary of matching lines.""" + # For each file of the diff, the entry key is the filename, + # and the value is a set of row numbers to consider. + rv = {} + path = nrows = None + for line in diff.splitlines(): + if nrows: + if line[:1] != '-': + nrows -= 1 + continue + if line[:3] == '@@ ': + hunk_match = HUNK_REGEX.match(line) + row, nrows = [int(g or '1') for g in hunk_match.groups()] + rv[path].update(range(row, row + nrows)) + elif line[:3] == '+++': + path = line[4:].split('\t', 1)[0] + if path[:2] == 'b/': + path = path[2:] + rv[path] = set() + return dict([(os.path.join(parent, path), rows) + for (path, rows) in rv.items() + if rows and filename_match(path, patterns)]) + + +def filename_match(filename, patterns, default=True): + """ + Check if patterns contains a pattern that matches filename. + If patterns is unspecified, this always returns True. + """ + if not patterns: + return default + return any(fnmatch(filename, pattern) for pattern in patterns) + + +############################################################################## +# Framework to run all checks +############################################################################## + + +_checks = {'physical_line': {}, 'logical_line': {}, 'tree': {}} + + +def register_check(check, codes=None): + """ + Register a new check object. + """ + def _add_check(check, kind, codes, args): + if check in _checks[kind]: + _checks[kind][check][0].extend(codes or []) + else: + _checks[kind][check] = (codes or [''], args) + if inspect.isfunction(check): + args = inspect.getargspec(check)[0] + if args and args[0] in ('physical_line', 'logical_line'): + if codes is None: + codes = ERRORCODE_REGEX.findall(check.__doc__ or '') + _add_check(check, args[0], codes, args) + elif inspect.isclass(check): + if inspect.getargspec(check.__init__)[0][:2] == ['self', 'tree']: + _add_check(check, 'tree', codes, None) + + +def init_checks_registry(): + """ + Register all globally visible functions where the first argument name + is 'physical_line' or 'logical_line'. + """ + mod = inspect.getmodule(register_check) + for (name, function) in inspect.getmembers(mod, inspect.isfunction): + register_check(function) +init_checks_registry() + + +class Checker(object): """ Load a Python source file, tokenize it, check coding style. """ - def __init__(self, filename): + def __init__(self, filename=None, lines=None, + options=None, report=None, **kwargs): + if options is None: + options = StyleGuide(kwargs).options + else: + assert not kwargs + self._io_error = None + self._physical_checks = options.physical_checks + self._logical_checks = options.logical_checks + self._ast_checks = options.ast_checks + self.max_line_length = options.max_line_length + self.verbose = options.verbose self.filename = filename - self.lines = file(filename).readlines() - self.physical_checks = find_checks('physical_line') - self.logical_checks = find_checks('logical_line') - options.counters['physical lines'] = \ - options.counters.get('physical lines', 0) + len(self.lines) + if filename is None: + self.filename = 'stdin' + self.lines = lines or [] + elif filename == '-': + self.filename = 'stdin' + self.lines = stdin_get_value().splitlines(True) + elif lines is None: + try: + self.lines = readlines(filename) + except IOError: + exc_type, exc = sys.exc_info()[:2] + self._io_error = '%s: %s' % (exc_type.__name__, exc) + self.lines = [] + else: + self.lines = lines + self.report = report or options.report + self.report_error = self.report.error + + def report_invalid_syntax(self): + exc_type, exc = sys.exc_info()[:2] + offset = exc.args[1] + if len(offset) > 2: + offset = offset[1:3] + self.report_error(offset[0], offset[1] or 0, + 'E901 %s: %s' % (exc_type.__name__, exc.args[0]), + self.report_invalid_syntax) + report_invalid_syntax.__doc__ = " Check if the syntax is valid." def readline(self): """ @@ -503,9 +1248,9 @@ class Checker: Run all physical checks on a raw input line. """ self.physical_line = line - if self.indent_char is None and len(line) and line[0] in ' \t': + if self.indent_char is None and line[:1] in WHITESPACE: self.indent_char = line[0] - for name, check, argument_names in self.physical_checks: + for name, check, argument_names in self._physical_checks: result = self.run_check(check, argument_names) if result is not None: offset, text = result @@ -521,21 +1266,21 @@ class Checker: previous = None for token in self.tokens: token_type, text = token[0:2] - if token_type in (tokenize.COMMENT, tokenize.NL, - tokenize.INDENT, tokenize.DEDENT, - tokenize.NEWLINE): + if token_type in SKIP_TOKENS: continue if token_type == tokenize.STRING: text = mute_string(text) if previous: - end_line, end = previous[3] - start_line, start = token[2] - if end_line != start_line: # different row - if self.lines[end_line - 1][end - 1] not in '{[(': + end_row, end = previous[3] + start_row, start = token[2] + if end_row != start_row: # different row + prev_text = self.lines[end_row - 1][end - 1] + if prev_text == ',' or (prev_text not in '{[(' + and text not in '}])'): logical.append(' ') length += 1 - elif end != start: # different column - fill = self.lines[end_line - 1][end:start] + elif end != start: # different column + fill = self.lines[end_row - 1][end:start] logical.append(fill) length += len(fill) self.mapping.append((length, token)) @@ -543,300 +1288,573 @@ class Checker: length += len(text) previous = token self.logical_line = ''.join(logical) - assert self.logical_line.lstrip() == self.logical_line - assert self.logical_line.rstrip() == self.logical_line + # With Python 2, if the line ends with '\r\r\n' the assertion fails + # assert self.logical_line.strip() == self.logical_line def check_logical(self): """ Build a line from tokens and run all logical checks on it. """ - options.counters['logical lines'] = \ - options.counters.get('logical lines', 0) + 1 self.build_tokens_line() + self.report.increment_logical_line() first_line = self.lines[self.mapping[0][1][2][0] - 1] indent = first_line[:self.mapping[0][1][2][1]] self.previous_indent_level = self.indent_level self.indent_level = expand_indent(indent) - if options.verbose >= 2: - print self.logical_line[:80].rstrip() - for name, check, argument_names in self.logical_checks: - if options.verbose >= 3: - print ' ', name - result = self.run_check(check, argument_names) - if result is not None: + if self.verbose >= 2: + print(self.logical_line[:80].rstrip()) + for name, check, argument_names in self._logical_checks: + if self.verbose >= 4: + print(' ' + name) + for result in self.run_check(check, argument_names): offset, text = result - if type(offset) is tuple: - original_number, original_offset = offset + if isinstance(offset, tuple): + orig_number, orig_offset = offset else: for token_offset, token in self.mapping: if offset >= token_offset: - original_number = token[2][0] - original_offset = (token[2][1] - + offset - token_offset) - self.report_error(original_number, original_offset, - text, check) + orig_number = token[2][0] + orig_offset = (token[2][1] + offset - token_offset) + self.report_error(orig_number, orig_offset, text, check) self.previous_logical = self.logical_line - def check_all(self): + def check_ast(self): + try: + tree = compile(''.join(self.lines), '', 'exec', PyCF_ONLY_AST) + except SyntaxError: + return self.report_invalid_syntax() + for name, cls, _ in self._ast_checks: + checker = cls(tree, self.filename) + for lineno, offset, text, check in checker.run(): + if not noqa(self.lines[lineno - 1]): + self.report_error(lineno, offset, text, check) + + def generate_tokens(self): + if self._io_error: + self.report_error(1, 0, 'E902 %s' % self._io_error, readlines) + tokengen = tokenize.generate_tokens(self.readline_check_physical) + try: + for token in tokengen: + yield token + except (SyntaxError, tokenize.TokenError): + self.report_invalid_syntax() + + def check_all(self, expected=None, line_offset=0): """ Run all checks on the input file. """ - self.file_errors = 0 + self.report.init_file(self.filename, self.lines, expected, line_offset) + if self._ast_checks: + self.check_ast() self.line_number = 0 self.indent_char = None self.indent_level = 0 self.previous_logical = '' - self.blank_lines = 0 self.tokens = [] + self.blank_lines = blank_lines_before_comment = 0 parens = 0 - for token in tokenize.generate_tokens(self.readline_check_physical): - # print tokenize.tok_name[token[0]], repr(token) + for token in self.generate_tokens(): self.tokens.append(token) token_type, text = token[0:2] - if token_type == tokenize.OP and text in '([{': - parens += 1 - if token_type == tokenize.OP and text in '}])': - parens -= 1 - if token_type == tokenize.NEWLINE and not parens: - self.check_logical() - self.blank_lines = 0 - self.tokens = [] - if token_type == tokenize.NL and not parens: - self.blank_lines += 1 - self.tokens = [] - if token_type == tokenize.COMMENT: - source_line = token[4] - token_start = token[2][1] - if source_line[:token_start].strip() == '': + if self.verbose >= 3: + if token[2][0] == token[3][0]: + pos = '[%s:%s]' % (token[2][1] or '', token[3][1]) + else: + pos = 'l.%s' % token[3][0] + print('l.%s\t%s\t%s\t%r' % + (token[2][0], pos, tokenize.tok_name[token[0]], text)) + if token_type == tokenize.OP: + if text in '([{': + parens += 1 + elif text in '}])': + parens -= 1 + elif not parens: + if token_type == tokenize.NEWLINE: + if self.blank_lines < blank_lines_before_comment: + self.blank_lines = blank_lines_before_comment + self.check_logical() + self.tokens = [] + self.blank_lines = blank_lines_before_comment = 0 + elif token_type == tokenize.NL: + if len(self.tokens) == 1: + # The physical line contains only this token. + self.blank_lines += 1 + self.tokens = [] + elif token_type == tokenize.COMMENT and len(self.tokens) == 1: + if blank_lines_before_comment < self.blank_lines: + blank_lines_before_comment = self.blank_lines self.blank_lines = 0 - return self.file_errors + if COMMENT_WITH_NL: + # The comment also ends a physical line + self.tokens = [] + return self.report.get_file_results() + + +class BaseReport(object): + """Collect the results of the checks.""" + print_filename = False + + def __init__(self, options): + self._benchmark_keys = options.benchmark_keys + self._ignore_code = options.ignore_code + # Results + self.elapsed = 0 + self.total_errors = 0 + self.counters = dict.fromkeys(self._benchmark_keys, 0) + self.messages = {} + + def start(self): + """Start the timer.""" + self._start_time = time.time() + + def stop(self): + """Stop the timer.""" + self.elapsed = time.time() - self._start_time + + def init_file(self, filename, lines, expected, line_offset): + """Signal a new file.""" + self.filename = filename + self.lines = lines + self.expected = expected or () + self.line_offset = line_offset + self.file_errors = 0 + self.counters['files'] += 1 + self.counters['physical lines'] += len(lines) - def report_error(self, line_number, offset, text, check): - """ - Report an error, according to options. - """ - if options.quiet == 1 and not self.file_errors: - message(self.filename) - self.file_errors += 1 + def increment_logical_line(self): + """Signal a new logical line.""" + self.counters['logical lines'] += 1 + + def error(self, line_number, offset, text, check): + """Report an error, according to options.""" code = text[:4] - options.counters[code] = options.counters.get(code, 0) + 1 - options.messages[code] = text[5:] - if options.quiet: + if self._ignore_code(code): return - if options.testsuite: - base = os.path.basename(self.filename)[:4] - if base == code: - return - if base[0] == 'E' and code[0] == 'W': - return - if ignore_code(code): + if code in self.counters: + self.counters[code] += 1 + else: + self.counters[code] = 1 + self.messages[code] = text[5:] + # Don't care about expected errors or warnings + if code in self.expected: return - if options.counters[code] == 1 or options.repeat: - message("%s:%s:%d: %s" % - (self.filename, line_number, offset + 1, text)) - if options.show_source: - line = self.lines[line_number - 1] - message(line.rstrip()) - message(' ' * offset + '^') - if options.show_pep8: - message(check.__doc__.lstrip('\n').rstrip()) - - -def input_file(filename): - """ - Run all checks on a Python source file. - """ - if excluded(filename) or not filename_match(filename): - return 0 - if options.verbose: - message('checking ' + filename) - options.counters['files'] = options.counters.get('files', 0) + 1 - errors = Checker(filename).check_all() - if options.testsuite and not errors: - message("%s: %s" % (filename, "no errors found")) - return errors - - -def input_dir(dirname): - """ - Check all Python source files in this directory and all subdirectories. - """ - dirname = dirname.rstrip('/') - if excluded(dirname): - return 0 - errors = 0 - for root, dirs, files in os.walk(dirname): - if options.verbose: - message('directory ' + root) - options.counters['directories'] = \ - options.counters.get('directories', 0) + 1 - dirs.sort() - for subdir in dirs: - if excluded(subdir): - dirs.remove(subdir) - files.sort() - for filename in files: - errors += input_file(os.path.join(root, filename)) - return errors - - -def excluded(filename): - """ - Check if options.exclude contains a pattern that matches filename. - """ - basename = os.path.basename(filename) - for pattern in options.exclude: - if fnmatch(basename, pattern): - # print basename, 'excluded because it matches', pattern - return True - - -def filename_match(filename): - """ - Check if options.filename contains a pattern that matches filename. - If options.filename is unspecified, this always returns True. - """ - if not options.filename: - return True - for pattern in options.filename: - if fnmatch(filename, pattern): - return True - - -def ignore_code(code): - """ - Check if options.ignore contains a prefix of the error code. - """ - for ignore in options.ignore: - if code.startswith(ignore): - return True - - -def get_error_statistics(): - """Get error statistics.""" - return get_statistics("E") + if self.print_filename and not self.file_errors: + print(self.filename) + self.file_errors += 1 + self.total_errors += 1 + return code + def get_file_results(self): + """Return the count of errors and warnings for this file.""" + return self.file_errors -def get_warning_statistics(): - """Get warning statistics.""" - return get_statistics("W") + def get_count(self, prefix=''): + """Return the total count of errors and warnings.""" + return sum([self.counters[key] + for key in self.messages if key.startswith(prefix)]) + def get_statistics(self, prefix=''): + """ + Get statistics for message codes that start with the prefix. -def get_statistics(prefix=''): - """ - Get statistics for message codes that start with the prefix. + prefix='' matches all errors and warnings + prefix='E' matches all errors + prefix='W' matches all warnings + prefix='E4' matches all errors that have to do with imports + """ + return ['%-7s %s %s' % (self.counters[key], key, self.messages[key]) + for key in sorted(self.messages) if key.startswith(prefix)] + + def print_statistics(self, prefix=''): + """Print overall statistics (number of errors and warnings).""" + for line in self.get_statistics(prefix): + print(line) + + def print_benchmark(self): + """Print benchmark numbers.""" + print('%-7.2f %s' % (self.elapsed, 'seconds elapsed')) + if self.elapsed: + for key in self._benchmark_keys: + print('%-7d %s per second (%d total)' % + (self.counters[key] / self.elapsed, key, + self.counters[key])) + + +class FileReport(BaseReport): + """Collect the results of the checks and print only the filenames.""" + print_filename = True + + +class StandardReport(BaseReport): + """Collect and print the results of the checks.""" + + def __init__(self, options): + super(StandardReport, self).__init__(options) + self._fmt = REPORT_FORMAT.get(options.format.lower(), + options.format) + self._repeat = options.repeat + self._show_source = options.show_source + self._show_pep8 = options.show_pep8 + + def init_file(self, filename, lines, expected, line_offset): + """Signal a new file.""" + self._deferred_print = [] + return super(StandardReport, self).init_file( + filename, lines, expected, line_offset) + + def error(self, line_number, offset, text, check): + """Report an error, according to options.""" + code = super(StandardReport, self).error(line_number, offset, + text, check) + if code and (self.counters[code] == 1 or self._repeat): + self._deferred_print.append( + (line_number, offset, code, text[5:], check.__doc__)) + return code + + def get_file_results(self): + """Print the result and return the overall count for this file.""" + self._deferred_print.sort() + for line_number, offset, code, text, doc in self._deferred_print: + print(self._fmt % { + 'path': self.filename, + 'row': self.line_offset + line_number, 'col': offset + 1, + 'code': code, 'text': text, + }) + if self._show_source: + if line_number > len(self.lines): + line = '' + else: + line = self.lines[line_number - 1] + print(line.rstrip()) + print(' ' * offset + '^') + if self._show_pep8 and doc: + print(doc.lstrip('\n').rstrip()) + return self.file_errors - prefix='' matches all errors and warnings - prefix='E' matches all errors - prefix='W' matches all warnings - prefix='E4' matches all errors that have to do with imports - """ - stats = [] - keys = options.messages.keys() - keys.sort() - for key in keys: - if key.startswith(prefix): - stats.append('%-7s %s %s' % - (options.counters[key], key, options.messages[key])) - return stats +class DiffReport(StandardReport): + """Collect and print the results for the changed lines only.""" -def print_statistics(prefix=''): - """Print overall statistics (number of errors and warnings).""" - for line in get_statistics(prefix): - print line + def __init__(self, options): + super(DiffReport, self).__init__(options) + self._selected = options.selected_lines + def error(self, line_number, offset, text, check): + if line_number not in self._selected[self.filename]: + return + return super(DiffReport, self).error(line_number, offset, text, check) + + +class StyleGuide(object): + """Initialize a PEP-8 instance with few options.""" + + def __init__(self, *args, **kwargs): + # build options from the command line + self.checker_class = kwargs.pop('checker_class', Checker) + parse_argv = kwargs.pop('parse_argv', False) + config_file = kwargs.pop('config_file', None) + parser = kwargs.pop('parser', None) + options, self.paths = process_options( + parse_argv=parse_argv, config_file=config_file, parser=parser) + if args or kwargs: + # build options from dict + options_dict = dict(*args, **kwargs) + options.__dict__.update(options_dict) + if 'paths' in options_dict: + self.paths = options_dict['paths'] + + self.runner = self.input_file + self.options = options + + if not options.reporter: + options.reporter = BaseReport if options.quiet else StandardReport + + for index, value in enumerate(options.exclude): + options.exclude[index] = value.rstrip('/') + options.select = tuple(options.select or ()) + if not (options.select or options.ignore or + options.testsuite or options.doctest) and DEFAULT_IGNORE: + # The default choice: ignore controversial checks + options.ignore = tuple(DEFAULT_IGNORE.split(',')) + else: + # Ignore all checks which are not explicitly selected + options.ignore = tuple(options.ignore or options.select and ('',)) + options.benchmark_keys = BENCHMARK_KEYS[:] + options.ignore_code = self.ignore_code + options.physical_checks = self.get_checks('physical_line') + options.logical_checks = self.get_checks('logical_line') + options.ast_checks = self.get_checks('tree') + self.init_report() + + def init_report(self, reporter=None): + """Initialize the report instance.""" + self.options.report = (reporter or self.options.reporter)(self.options) + return self.options.report + + def check_files(self, paths=None): + """Run all checks on the paths.""" + if paths is None: + paths = self.paths + report = self.options.report + runner = self.runner + report.start() + try: + for path in paths: + if os.path.isdir(path): + self.input_dir(path) + elif not self.excluded(path): + runner(path) + except KeyboardInterrupt: + print('... stopped') + report.stop() + return report + + def input_file(self, filename, lines=None, expected=None, line_offset=0): + """Run all checks on a Python source file.""" + if self.options.verbose: + print('checking %s' % filename) + fchecker = self.checker_class( + filename, lines=lines, options=self.options) + return fchecker.check_all(expected=expected, line_offset=line_offset) + + def input_dir(self, dirname): + """Check all files in this directory and all subdirectories.""" + dirname = dirname.rstrip('/') + if self.excluded(dirname): + return 0 + counters = self.options.report.counters + verbose = self.options.verbose + filepatterns = self.options.filename + runner = self.runner + for root, dirs, files in os.walk(dirname): + if verbose: + print('directory ' + root) + counters['directories'] += 1 + for subdir in sorted(dirs): + if self.excluded(os.path.join(root, subdir)): + dirs.remove(subdir) + for filename in sorted(files): + # contain a pattern that matches? + if ((filename_match(filename, filepatterns) and + not self.excluded(filename))): + runner(os.path.join(root, filename)) + + def excluded(self, filename): + """ + Check if options.exclude contains a pattern that matches filename. + """ + basename = os.path.basename(filename) + return any((filename_match(filename, self.options.exclude, + default=False), + filename_match(basename, self.options.exclude, + default=False))) -def print_benchmark(elapsed): - """ - Print benchmark numbers. - """ - print '%-7.2f %s' % (elapsed, 'seconds elapsed') - keys = ['directories', 'files', - 'logical lines', 'physical lines'] - for key in keys: - if key in options.counters: - print '%-7d %s per second (%d total)' % ( - options.counters[key] / elapsed, key, - options.counters[key]) + def ignore_code(self, code): + """ + Check if the error code should be ignored. + If 'options.select' contains a prefix of the error code, + return False. Else, if 'options.ignore' contains a prefix of + the error code, return True. + """ + return (code.startswith(self.options.ignore) and + not code.startswith(self.options.select)) -def process_options(arglist=None): - """ - Process options passed either via arglist or via command line args. - """ - global options, args - usage = "%prog [options] input ..." - parser = OptionParser(usage) + def get_checks(self, argument_name): + """ + Find all globally visible functions where the first argument name + starts with argument_name and which contain selected tests. + """ + checks = [] + for check, attrs in _checks[argument_name].items(): + (codes, args) = attrs + if any(not (code and self.ignore_code(code)) for code in codes): + checks.append((check.__name__, check, args)) + return sorted(checks) + + +def get_parser(prog='pep8', version=__version__): + parser = OptionParser(prog=prog, version=version, + usage="%prog [options] input ...") + parser.config_options = [ + 'exclude', 'filename', 'select', 'ignore', 'max-line-length', 'count', + 'format', 'quiet', 'show-pep8', 'show-source', 'statistics', 'verbose'] parser.add_option('-v', '--verbose', default=0, action='count', help="print status messages, or debug with -vv") parser.add_option('-q', '--quiet', default=0, action='count', help="report only file names, or nothing with -qq") - parser.add_option('--exclude', metavar='patterns', default=default_exclude, - help="skip matches (default %s)" % default_exclude) - parser.add_option('--filename', metavar='patterns', - help="only check matching files (e.g. *.py)") + parser.add_option('-r', '--repeat', default=True, action='store_true', + help="(obsolete) show all occurrences of the same error") + parser.add_option('--first', action='store_false', dest='repeat', + help="show first occurrence of each error") + parser.add_option('--exclude', metavar='patterns', default=DEFAULT_EXCLUDE, + help="exclude files or directories which match these " + "comma separated patterns (default: %default)") + parser.add_option('--filename', metavar='patterns', default='*.py', + help="when parsing directories, only check filenames " + "matching these comma separated patterns " + "(default: %default)") + parser.add_option('--select', metavar='errors', default='', + help="select errors and warnings (e.g. E,W6)") parser.add_option('--ignore', metavar='errors', default='', help="skip errors and warnings (e.g. E4,W)") - parser.add_option('--repeat', action='store_true', - help="show all occurrences of the same error") parser.add_option('--show-source', action='store_true', help="show source code for each error") parser.add_option('--show-pep8', action='store_true', - help="show text of PEP 8 for each error") + help="show text of PEP 8 for each error " + "(implies --first)") parser.add_option('--statistics', action='store_true', help="count errors and warnings") - parser.add_option('--benchmark', action='store_true', - help="measure processing speed") - parser.add_option('--testsuite', metavar='dir', - help="run regression tests from dir") - parser.add_option('--doctest', action='store_true', - help="run doctest on myself") + parser.add_option('--count', action='store_true', + help="print total number of errors and warnings " + "to standard error and set exit code to 1 if " + "total is not null") + parser.add_option('--max-line-length', type='int', metavar='n', + default=MAX_LINE_LENGTH, + help="set maximum allowed line length " + "(default: %default)") + parser.add_option('--format', metavar='format', default='default', + help="set the error format [default|pylint|]") + parser.add_option('--diff', action='store_true', + help="report only lines changed according to the " + "unified diff received on STDIN") + group = parser.add_option_group("Testing Options") + if os.path.exists(TESTSUITE_PATH): + group.add_option('--testsuite', metavar='dir', + help="run regression tests from dir") + group.add_option('--doctest', action='store_true', + help="run doctest on myself") + group.add_option('--benchmark', action='store_true', + help="measure processing speed") + return parser + + +def read_config(options, args, arglist, parser): + """Read both user configuration and local configuration.""" + config = RawConfigParser() + + user_conf = options.config + if user_conf and os.path.isfile(user_conf): + if options.verbose: + print('user configuration: %s' % user_conf) + config.read(user_conf) + + parent = tail = args and os.path.abspath(os.path.commonprefix(args)) + while tail: + for name in PROJECT_CONFIG: + local_conf = os.path.join(parent, name) + if os.path.isfile(local_conf): + break + else: + parent, tail = os.path.split(parent) + continue + if options.verbose: + print('local configuration: %s' % local_conf) + config.read(local_conf) + break + + pep8_section = parser.prog + if config.has_section(pep8_section): + option_list = dict([(o.dest, o.type or o.action) + for o in parser.option_list]) + + # First, read the default values + new_options, _ = parser.parse_args([]) + + # Second, parse the configuration + for opt in config.options(pep8_section): + if options.verbose > 1: + print(" %s = %s" % (opt, config.get(pep8_section, opt))) + if opt.replace('_', '-') not in parser.config_options: + print("Unknown option: '%s'\n not in [%s]" % + (opt, ' '.join(parser.config_options))) + sys.exit(1) + normalized_opt = opt.replace('-', '_') + opt_type = option_list[normalized_opt] + if opt_type in ('int', 'count'): + value = config.getint(pep8_section, opt) + elif opt_type == 'string': + value = config.get(pep8_section, opt) + else: + assert opt_type in ('store_true', 'store_false') + value = config.getboolean(pep8_section, opt) + setattr(new_options, normalized_opt, value) + + # Third, overwrite with the command-line options + options, _ = parser.parse_args(arglist, values=new_options) + options.doctest = options.testsuite = False + return options + + +def process_options(arglist=None, parse_argv=False, config_file=None, + parser=None): + """Process options passed either via arglist or via command line args.""" + if not arglist and not parse_argv: + # Don't read the command line if the module is used as a library. + arglist = [] + if not parser: + parser = get_parser() + if not parser.has_option('--config'): + if config_file is True: + config_file = DEFAULT_CONFIG + group = parser.add_option_group("Configuration", description=( + "The project options are read from the [%s] section of the " + "tox.ini file or the setup.cfg file located in any parent folder " + "of the path(s) being processed. Allowed options are: %s." % + (parser.prog, ', '.join(parser.config_options)))) + group.add_option('--config', metavar='path', default=config_file, + help="user config file location (default: %default)") options, args = parser.parse_args(arglist) - if options.testsuite: + options.reporter = None + + if options.ensure_value('testsuite', False): args.append(options.testsuite) - if len(args) == 0: - parser.error('input not specified') - options.prog = os.path.basename(sys.argv[0]) - options.exclude = options.exclude.split(',') - for index in range(len(options.exclude)): - options.exclude[index] = options.exclude[index].rstrip('/') + elif not options.ensure_value('doctest', False): + if parse_argv and not args: + if options.diff or any(os.path.exists(name) + for name in PROJECT_CONFIG): + args = ['.'] + else: + parser.error('input not specified') + options = read_config(options, args, arglist, parser) + options.reporter = parse_argv and options.quiet == 1 and FileReport + if options.filename: options.filename = options.filename.split(',') + options.exclude = options.exclude.split(',') + if options.select: + options.select = options.select.split(',') if options.ignore: options.ignore = options.ignore.split(',') - else: - options.ignore = [] - options.counters = {} - options.messages = {} + + if options.diff: + options.reporter = DiffReport + stdin = stdin_get_value() + options.selected_lines = parse_udiff(stdin, options.filename, args[0]) + args = sorted(options.selected_lines) return options, args def _main(): - """ - Parse options and run checks on Python source. - """ - options, args = process_options() - if options.doctest: - import doctest - return doctest.testmod() - start_time = time.time() - errors = 0 - for path in args: - # skip emacs backups - if path.startswith(".#"): - continue - if os.path.isdir(path): - errors += input_dir(path) - else: - errors += input_file(path) - elapsed = time.time() - start_time + """Parse options and run checks on Python source.""" + pep8style = StyleGuide(parse_argv=True, config_file=True) + options = pep8style.options + if options.doctest or options.testsuite: + from testsuite.support import run_tests + report = run_tests(pep8style) + else: + report = pep8style.check_files() if options.statistics: - print_statistics() + report.print_statistics() if options.benchmark: - print_benchmark(elapsed) - return errors > 0 + report.print_benchmark() + if options.testsuite and not options.quiet: + report.print_results() + if report.total_errors: + if options.count: + sys.stderr.write(str(report.total_errors) + '\n') + sys.exit(1) if __name__ == '__main__': - sys.exit(_main()) + _main() diff --git a/scannerlexer.c b/scannerlexer.c index 5245677..9933f40 100644 --- a/scannerlexer.c +++ b/scannerlexer.c @@ -8,7 +8,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 36 +#define YY_FLEX_SUBMINOR_VERSION 37 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -360,8 +360,8 @@ static void yy_fatal_error (yyconst char msg[] ); *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; -#define YY_NUM_RULES 123 -#define YY_END_OF_BUFFER 124 +#define YY_NUM_RULES 132 +#define YY_END_OF_BUFFER 133 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -369,96 +369,103 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_acclist[779] = +static yyconst flex_int16_t yy_acclist[838] = { 0, - 124, 122, 123, 3, 122, 123, 1, 123, 36, 122, - 123, 122, 123, 11, 122, 123, 31, 122, 123, 33, - 122, 123, 122, 123, 20, 122, 123, 21, 122, 123, - 29, 122, 123, 27, 122, 123, 60, 122, 123, 28, - 122, 123, 26, 122, 123, 30, 122, 123, 115, 122, - 123, 115, 122, 123, 23, 122, 123, 22, 122, 123, - 38, 122, 123, 37, 122, 123, 39, 122, 123, 25, - 122, 123, 76, 112, 122, 123, 76, 112, 122, 123, - 76, 112, 122, 123, 16, 122, 123, 122, 123, 18, - 122, 123, 32, 122, 123, 76, 112, 122, 123, 76, - - 112, 122, 123, 76, 112, 122, 123, 76, 112, 122, - 123, 76, 112, 122, 123, 76, 112, 122, 123, 76, - 112, 122, 123, 76, 112, 122, 123, 76, 112, 122, - 123, 76, 112, 122, 123, 76, 112, 122, 123, 76, - 112, 122, 123, 76, 112, 122, 123, 76, 112, 122, - 123, 76, 112, 122, 123, 76, 112, 122, 123, 12, - 122, 123, 34, 122, 123, 14, 122, 123, 35, 122, - 123, 3, 1, 53, 120, 44, 15, 56, 46, 118, - 42, 58, 40, 59, 41, 61, 116, 4, 6, 43, - 116, 114, 115, 115, 115, 115, 19, 13, 17, 48, - - 54, 52, 55, 49, 76, 112, 76, 112, 2, 45, - 76, 112, 76, 112, 76, 112, 76, 112, 76, 112, - 76, 112, 76, 112, 76, 112, 76, 112, 76, 85, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 112, 76, 112, 76, 93, 112, 76, 112, 76, 112, - 76, 112, 76, 112, 76, 112, 76, 112, 76, 112, - 76, 112, 76, 112, 76, 112, 76, 112, 47, 57, - 24, 116, 6, 114, 115, 114, 115, 117, 115, 115, - 115, 113, 50, 51, 76, 112, 121, 119, 76, 112, - 76, 112, 76, 112, 76, 112, 76, 112, 76, 112, - - 76, 112, 76, 112, 76, 112, 76, 77, 112, 76, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 112, 76, 91, 112, 76, 112, 76, 112, 76, 95, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 112, 76, 112, 116, 114, 115, 114, 115, 114, 115, - 117, 115, 113, 113, 76, 112, 76, 112, 76, 112, - 76, 112, 76, 112, 76, 112, 76, 112, 76, 112, - - 76, 112, 76, 112, 76, 112, 76, 112, 76, 78, - 112, 76, 112, 76, 80, 112, 76, 81, 112, 76, - 112, 76, 112, 76, 112, 76, 112, 76, 87, 112, - 76, 88, 112, 76, 112, 76, 112, 76, 92, 112, - 76, 112, 76, 96, 112, 76, 112, 76, 112, 76, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 109, 112, 76, 112, 76, 112, 10, 114, 115, 113, - 113, 113, 76, 112, 76, 112, 73, 76, 112, 62, - 76, 112, 76, 112, 76, 112, 76, 112, 76, 112, - - 76, 112, 76, 112, 76, 112, 76, 112, 76, 79, - 112, 76, 82, 112, 76, 112, 76, 112, 76, 112, - 76, 112, 76, 90, 112, 76, 112, 76, 112, 76, - 112, 76, 112, 76, 100, 112, 76, 112, 76, 112, - 76, 112, 76, 112, 76, 112, 76, 112, 76, 107, - 112, 76, 112, 76, 112, 76, 111, 112, 113, 76, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 112, 76, 112, 76, 112, 76, 86, 112, 76, 89, - 112, 76, 94, 112, 76, 112, 76, 112, 76, 99, - - 112, 76, 101, 112, 76, 102, 112, 76, 103, 112, - 76, 104, 112, 76, 105, 112, 76, 112, 76, 112, - 76, 112, 5, 76, 112, 76, 112, 63, 76, 112, - 76, 112, 66, 76, 112, 76, 112, 76, 112, 76, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 84, 112, 76, 112, 76, 112, 76, 106, 112, 76, - 112, 76, 112, 76, 112, 76, 112, 76, 112, 76, - 112, 68, 76, 112, 76, 112, 76, 112, 76, 112, - 72, 76, 112, 76, 83, 112, 76, 97, 112, 76, - 98, 112, 76, 108, 112, 76, 110, 112, 8, 9, - - 76, 112, 76, 112, 76, 112, 76, 112, 69, 76, - 112, 76, 112, 76, 112, 7, 8, 76, 112, 76, - 112, 76, 112, 76, 112, 71, 76, 112, 70, 76, - 112, 76, 112, 76, 112, 65, 76, 112, 76, 112, - 76, 112, 76, 112, 76, 112, 76, 112, 76, 112, - 76, 112, 64, 76, 112, 67, 76, 112, 76, 112, - 76, 112, 76, 112, 76, 112, 76, 112, 76, 112, - 74, 76, 112, 76, 112, 75, 76, 112 + 133, 131, 132, 3, 131, 132, 1, 132, 37, 131, + 132, 131, 132, 12, 131, 132, 32, 131, 132, 34, + 131, 132, 131, 132, 21, 131, 132, 22, 131, 132, + 30, 131, 132, 28, 131, 132, 61, 131, 132, 29, + 131, 132, 27, 131, 132, 31, 131, 132, 124, 131, + 132, 124, 131, 132, 24, 131, 132, 23, 131, 132, + 39, 131, 132, 38, 131, 132, 40, 131, 132, 26, + 131, 132, 81, 121, 131, 132, 81, 121, 131, 132, + 81, 121, 131, 132, 17, 131, 132, 131, 132, 19, + 131, 132, 33, 131, 132, 81, 121, 131, 132, 81, + + 121, 131, 132, 81, 121, 131, 132, 81, 121, 131, + 132, 81, 121, 131, 132, 81, 121, 131, 132, 81, + 121, 131, 132, 81, 121, 131, 132, 81, 121, 131, + 132, 81, 121, 131, 132, 81, 121, 131, 132, 81, + 121, 131, 132, 81, 121, 131, 132, 81, 121, 131, + 132, 81, 121, 131, 132, 81, 121, 131, 132, 13, + 131, 132, 35, 131, 132, 15, 131, 132, 36, 131, + 132, 3, 1, 54, 129, 45, 16, 57, 47, 127, + 43, 59, 41, 60, 42, 62, 125, 5, 7, 44, + 125, 123, 124, 124, 124, 124, 20, 14, 18, 49, + + 55, 53, 56, 50, 81, 121, 81, 121, 2, 46, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 90, + 121, 81, 121, 81, 121, 81, 121, 81, 121, 81, + 121, 81, 121, 81, 98, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 48, 58, + 25, 125, 4, 7, 123, 124, 123, 124, 126, 124, + 124, 124, 122, 51, 52, 81, 121, 130, 128, 81, + 121, 81, 121, 81, 121, 81, 121, 81, 121, 81, + + 121, 81, 121, 81, 121, 81, 121, 81, 121, 81, + 121, 81, 82, 121, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 96, 121, 81, + 121, 81, 121, 81, 100, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 125, 123, + 124, 123, 124, 123, 124, 126, 124, 122, 122, 81, + 121, 81, 121, 81, 121, 81, 121, 81, 121, 81, + + 121, 81, 121, 81, 121, 81, 121, 81, 121, 81, + 121, 81, 121, 81, 121, 81, 121, 81, 83, 121, + 81, 121, 81, 85, 121, 81, 86, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 92, 121, 81, + 93, 121, 81, 121, 81, 121, 81, 97, 121, 81, + 121, 81, 105, 121, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 118, + 121, 81, 121, 81, 121, 11, 123, 124, 122, 122, + 122, 81, 121, 81, 121, 78, 81, 121, 65, 81, + + 121, 81, 121, 81, 121, 81, 121, 81, 121, 81, + 121, 81, 121, 81, 121, 81, 121, 81, 121, 81, + 121, 81, 121, 81, 84, 121, 81, 87, 121, 81, + 121, 81, 121, 81, 121, 81, 121, 81, 95, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 109, + 121, 81, 121, 81, 121, 81, 121, 81, 121, 81, + 121, 81, 121, 81, 116, 121, 81, 121, 81, 121, + 81, 120, 121, 122, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 121, + + 81, 121, 81, 121, 81, 121, 81, 91, 121, 81, + 94, 121, 81, 99, 121, 81, 121, 81, 121, 81, + 108, 121, 81, 110, 121, 81, 111, 121, 81, 112, + 121, 81, 113, 121, 81, 114, 121, 81, 121, 81, + 121, 81, 121, 6, 81, 121, 81, 121, 66, 81, + 121, 81, 121, 69, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 89, 121, 81, + 121, 81, 121, 81, 115, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 121, 71, 81, + + 121, 81, 104, 121, 81, 121, 81, 121, 81, 121, + 75, 81, 121, 81, 121, 81, 121, 81, 88, 121, + 81, 106, 121, 81, 107, 121, 81, 117, 121, 81, + 119, 121, 9, 10, 81, 121, 81, 121, 81, 121, + 81, 121, 81, 121, 72, 81, 121, 81, 121, 81, + 121, 81, 103, 121, 81, 121, 8, 9, 81, 121, + 81, 121, 81, 121, 81, 121, 81, 102, 121, 74, + 81, 121, 73, 81, 121, 81, 121, 76, 81, 121, + 81, 121, 81, 121, 68, 81, 121, 81, 121, 81, + 101, 121, 81, 121, 81, 121, 81, 121, 81, 121, + + 81, 121, 77, 81, 121, 81, 121, 81, 121, 67, + 81, 121, 70, 81, 121, 81, 121, 81, 121, 63, + 81, 121, 81, 121, 81, 121, 81, 121, 64, 79, + 81, 121, 81, 121, 80, 81, 121 } ; -static yyconst flex_int16_t yy_accept[409] = +static yyconst flex_int16_t yy_accept[453] = { 0, 1, 1, 1, 2, 4, 7, 9, 12, 14, 17, 20, 23, 25, 28, 31, 34, 37, 40, 43, 46, @@ -475,36 +482,41 @@ static yyconst flex_int16_t yy_accept[409] = 225, 227, 229, 232, 234, 236, 238, 240, 242, 244, 247, 249, 251, 253, 255, 257, 259, 261, 263, 265, 267, 269, 270, 271, 271, 271, 271, 272, 272, 273, - 273, 273, 274, 276, 278, 278, 279, 280, 281, 282, - 283, 284, 285, 287, 287, 288, 288, 288, 289, 289, - 291, 293, 295, 297, 299, 301, 303, 305, 307, 310, - 312, 314, 316, 318, 320, 322, 324, 326, 328, 330, - 332, 335, 337, 339, 342, 344, 346, 348, 350, 352, - 354, 356, 358, 360, 362, 364, 366, 368, 370, 372, - - 374, 374, 374, 374, 374, 375, 375, 377, 379, 381, - 382, 383, 384, 385, 387, 389, 391, 393, 395, 397, - 399, 401, 403, 405, 407, 409, 412, 414, 417, 420, - 422, 424, 426, 428, 431, 434, 436, 438, 441, 443, - 446, 448, 450, 452, 454, 456, 458, 460, 462, 464, - 466, 468, 470, 473, 475, 477, 477, 478, 478, 478, - 478, 480, 481, 482, 483, 485, 487, 490, 493, 495, - 497, 499, 501, 503, 505, 507, 509, 512, 515, 517, - 519, 521, 523, 526, 528, 530, 532, 534, 537, 539, - 541, 543, 545, 547, 549, 552, 554, 556, 559, 559, - - 559, 559, 559, 560, 562, 564, 566, 568, 570, 572, - 574, 576, 578, 580, 582, 584, 586, 589, 592, 595, - 597, 599, 602, 605, 608, 611, 614, 617, 619, 621, - 623, 623, 623, 624, 626, 628, 631, 633, 636, 638, - 640, 642, 644, 646, 648, 650, 653, 655, 657, 660, - 662, 664, 664, 664, 666, 668, 670, 672, 675, 677, - 679, 681, 684, 687, 690, 693, 696, 699, 700, 700, - 701, 703, 705, 707, 709, 712, 714, 716, 717, 718, - 720, 722, 724, 726, 729, 732, 734, 736, 739, 741, - 743, 745, 747, 749, 751, 753, 756, 759, 761, 763, - - 765, 767, 769, 771, 774, 776, 779, 779 + 273, 274, 274, 275, 277, 279, 279, 280, 281, 282, + 283, 284, 285, 286, 288, 288, 289, 289, 289, 290, + 290, 292, 294, 296, 298, 300, 302, 304, 306, 308, + 310, 312, 315, 317, 319, 321, 323, 325, 327, 329, + 331, 333, 335, 337, 340, 342, 344, 347, 349, 351, + 353, 355, 357, 359, 361, 363, 365, 367, 369, 371, + + 373, 375, 377, 379, 379, 379, 379, 379, 380, 380, + 382, 384, 386, 387, 388, 389, 390, 392, 394, 396, + 398, 400, 402, 404, 406, 408, 410, 412, 414, 416, + 418, 421, 423, 426, 429, 431, 433, 435, 437, 440, + 443, 445, 447, 450, 452, 455, 457, 459, 461, 463, + 465, 467, 469, 471, 473, 475, 477, 479, 482, 484, + 486, 486, 487, 487, 487, 487, 489, 490, 491, 492, + 494, 496, 499, 502, 504, 506, 508, 510, 512, 514, + 516, 518, 520, 522, 524, 527, 530, 532, 534, 536, + 538, 541, 543, 545, 547, 549, 552, 554, 556, 558, + + 560, 562, 564, 567, 569, 571, 574, 574, 574, 574, + 574, 575, 577, 579, 579, 581, 583, 585, 587, 589, + 591, 593, 595, 597, 599, 601, 603, 605, 607, 610, + 613, 616, 618, 620, 623, 626, 629, 632, 635, 638, + 640, 642, 644, 644, 644, 645, 647, 649, 649, 652, + 654, 657, 659, 661, 663, 665, 667, 669, 671, 673, + 675, 677, 680, 682, 684, 687, 689, 691, 691, 691, + 693, 695, 695, 695, 697, 699, 702, 705, 707, 709, + 711, 714, 716, 718, 721, 724, 727, 730, 733, 734, + 734, 735, 737, 739, 739, 739, 741, 743, 745, 748, + + 750, 752, 755, 757, 758, 759, 761, 763, 763, 763, + 765, 767, 770, 773, 776, 778, 781, 783, 785, 785, + 785, 788, 790, 793, 795, 797, 799, 799, 799, 801, + 803, 806, 808, 810, 810, 810, 813, 816, 818, 820, + 821, 821, 823, 825, 825, 827, 829, 830, 833, 835, + 838, 838 } ; static yyconst flex_int32_t yy_ec[256] = @@ -513,16 +525,16 @@ static yyconst flex_int32_t yy_ec[256] = 4, 4, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 7, 8, 1, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, - 21, 22, 21, 23, 21, 24, 24, 25, 26, 27, - 28, 29, 30, 1, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 38, 38, 40, 38, 41, 42, 38, - 38, 38, 43, 44, 45, 38, 38, 46, 38, 38, - 47, 48, 49, 50, 51, 1, 52, 53, 54, 55, - - 56, 57, 58, 59, 60, 38, 61, 62, 63, 64, - 65, 66, 38, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 1, 1, 1, 1, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 23, 25, 23, 26, 27, 28, 29, 30, + 31, 32, 33, 1, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 41, 41, 43, 41, 44, 45, 41, + 41, 41, 46, 47, 48, 41, 41, 49, 41, 41, + 50, 51, 52, 53, 54, 1, 55, 56, 57, 58, + + 59, 60, 61, 62, 63, 41, 64, 65, 66, 67, + 68, 69, 41, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -539,200 +551,220 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[80] = +static yyconst flex_int32_t yy_meta[83] = { 0, 1, 2, 3, 1, 2, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 2, 1, 1, 1, 5, - 5, 5, 5, 5, 1, 1, 1, 2, 1, 1, - 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 1, 1, 1, 1, - 7, 6, 6, 6, 6, 6, 6, 7, 7, 7, + 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, + 2, 1, 1, 6, 6, 6, 6, 6, 6, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 1, + 1, 1, 1, 7, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 1, 1, 1, 1 + 7, 7, 7, 7, 7, 7, 7, 7, 1, 1, + 1, 1 } ; -static yyconst flex_int16_t yy_base[421] = +static yyconst flex_int16_t yy_base[465] = { 0, - 0, 0, 618, 619, 78, 0, 589, 74, 79, 57, - 77, 77, 619, 619, 588, 74, 619, 75, 73, 87, - 128, 87, 586, 619, 89, 586, 71, 619, 0, 562, - 112, 619, 609, 619, 583, 79, 50, 543, 72, 56, - 65, 70, 544, 79, 543, 551, 95, 532, 541, 539, - 544, 619, 62, 619, 619, 154, 0, 619, 121, 619, - 599, 155, 545, 533, 619, 619, 619, 619, 133, 619, - 596, 619, 619, 619, 619, 619, 619, 580, 171, 160, - 0, 619, 194, 126, 0, 220, 140, 121, 0, 619, - 619, 619, 569, 619, 619, 619, 568, 0, 558, 134, - - 175, 619, 619, 529, 193, 530, 523, 535, 522, 537, - 524, 530, 516, 517, 514, 514, 517, 514, 511, 0, - 78, 515, 151, 513, 95, 90, 517, 510, 129, 143, - 515, 619, 619, 243, 517, 521, 619, 253, 619, 545, - 0, 0, 238, 160, 264, 269, 168, 619, 164, 254, - 619, 619, 186, 232, 619, 568, 210, 619, 567, 504, - 186, 503, 494, 502, 500, 508, 503, 488, 0, 496, - 508, 503, 491, 203, 505, 503, 499, 491, 497, 500, - 0, 486, 490, 0, 491, 488, 478, 476, 478, 480, - 487, 473, 471, 471, 483, 473, 477, 481, 483, 472, - - 530, 472, 473, 290, 297, 501, 234, 619, 184, 619, - 619, 282, 219, 488, 489, 465, 463, 456, 460, 454, - 460, 457, 452, 461, 452, 0, 456, 0, 0, 447, - 455, 444, 451, 0, 0, 445, 442, 0, 446, 0, - 441, 441, 440, 437, 449, 439, 443, 448, 447, 445, - 435, 440, 0, 428, 440, 492, 619, 430, 430, 293, - 619, 258, 619, 261, 448, 450, 0, 439, 422, 420, - 431, 426, 421, 415, 419, 426, 0, 0, 417, 418, - 423, 414, 0, 421, 407, 415, 410, 0, 418, 415, - 417, 401, 410, 412, 0, 403, 406, 0, 409, 412, - - 449, 443, 619, 438, 416, 408, 398, 388, 392, 391, - 384, 386, 396, 386, 380, 380, 0, 0, 0, 392, - 393, 0, 0, 0, 0, 0, 0, 389, 389, 382, - 438, 437, 619, 419, 417, 0, 386, 0, 370, 381, - 374, 375, 379, 376, 353, 0, 341, 317, 0, 307, - 302, 0, 354, 305, 333, 283, 291, 0, 288, 295, - 297, 0, 0, 0, 0, 0, 0, 335, 343, 619, - 312, 292, 273, 276, 0, 271, 288, 619, 326, 294, - 302, 278, 268, 0, 0, 289, 287, 274, 264, 263, - 261, 246, 245, 238, 226, 0, 0, 221, 192, 191, - - 181, 164, 85, 0, 69, 0, 619, 359, 366, 373, - 376, 383, 386, 392, 399, 405, 412, 414, 421, 425 + 0, 0, 706, 707, 81, 0, 674, 77, 82, 57, + 80, 80, 707, 707, 673, 77, 707, 78, 76, 93, + 134, 193, 671, 707, 95, 671, 74, 707, 0, 647, + 106, 707, 697, 707, 668, 79, 45, 628, 67, 62, + 67, 71, 629, 60, 628, 636, 75, 617, 626, 624, + 629, 707, 62, 707, 707, 144, 0, 707, 112, 707, + 687, 144, 630, 618, 707, 707, 707, 707, 130, 707, + 684, 707, 707, 707, 707, 707, 707, 668, 247, 171, + 0, 707, 0, 157, 0, 222, 131, 110, 0, 707, + 707, 707, 654, 707, 707, 707, 653, 0, 643, 137, + + 151, 707, 707, 614, 221, 615, 608, 620, 607, 622, + 609, 615, 601, 602, 599, 599, 602, 599, 596, 0, + 115, 600, 123, 598, 125, 142, 602, 595, 127, 126, + 600, 707, 707, 276, 602, 606, 707, 293, 707, 630, + 707, 0, 0, 186, 185, 301, 309, 184, 707, 195, + 294, 707, 707, 179, 202, 707, 656, 212, 707, 655, + 589, 153, 588, 579, 587, 585, 593, 588, 573, 586, + 580, 0, 579, 591, 586, 574, 183, 588, 586, 582, + 574, 580, 583, 0, 569, 573, 0, 574, 571, 561, + 559, 561, 563, 570, 556, 554, 554, 566, 556, 560, + + 564, 566, 555, 616, 555, 556, 355, 363, 584, 192, + 707, 218, 707, 707, 295, 239, 571, 572, 548, 546, + 539, 543, 537, 274, 541, 536, 545, 536, 537, 538, + 0, 538, 0, 0, 529, 537, 526, 533, 0, 0, + 527, 524, 0, 528, 0, 523, 523, 522, 519, 531, + 521, 525, 530, 529, 527, 517, 522, 0, 510, 522, + 577, 707, 512, 512, 339, 707, 214, 707, 246, 530, + 532, 0, 345, 505, 503, 514, 509, 550, 503, 497, + 501, 508, 494, 510, 0, 0, 497, 498, 503, 494, + 0, 501, 487, 495, 490, 0, 498, 495, 497, 481, + + 490, 492, 0, 483, 486, 0, 489, 492, 532, 526, + 707, 519, 496, 352, 488, 478, 468, 472, 471, 515, + 463, 465, 475, 465, 511, 459, 457, 457, 0, 0, + 0, 469, 470, 0, 0, 0, 0, 0, 0, 466, + 466, 459, 518, 517, 707, 497, 495, 451, 359, 462, + 0, 446, 457, 466, 426, 406, 387, 381, 418, 376, + 379, 0, 367, 364, 0, 377, 375, 0, 430, 378, + 407, 365, 368, 356, 364, 0, 371, 359, 365, 367, + 0, 394, 354, 0, 0, 0, 0, 0, 406, 414, + 707, 380, 361, 359, 345, 340, 343, 338, 0, 337, + + 354, 353, 346, 707, 392, 358, 365, 328, 333, 338, + 329, 0, 0, 0, 323, 340, 349, 347, 328, 316, + 312, 311, 0, 308, 312, 311, 286, 273, 286, 255, + 0, 258, 233, 218, 212, 0, 0, 230, 209, 707, + 170, 182, 174, 133, 131, 101, 707, 0, 68, 0, + 707, 442, 449, 456, 459, 466, 469, 475, 482, 488, + 495, 497, 504, 508 } ; -static yyconst flex_int16_t yy_def[421] = +static yyconst flex_int16_t yy_def[465] = { 0, - 407, 1, 407, 407, 407, 408, 407, 409, 407, 407, - 407, 410, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 21, 407, 407, 407, 407, 407, 407, 411, 411, - 411, 407, 407, 407, 407, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 407, 407, 407, 407, 407, 408, 407, 409, 407, - 409, 407, 407, 407, 407, 407, 407, 407, 410, 407, - 410, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 412, 407, 407, 21, 22, 407, 407, 407, 413, 407, - 407, 407, 407, 407, 407, 407, 407, 411, 411, 414, - - 415, 407, 407, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 416, 412, 407, 407, 407, 407, 407, 407, 407, 413, - 407, 407, 411, 414, 407, 414, 415, 407, 415, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - - 417, 407, 407, 407, 407, 416, 407, 407, 407, 407, - 407, 407, 407, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 417, 407, 407, 407, 407, - 407, 407, 407, 407, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 407, 407, - - 407, 407, 407, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 407, 407, 407, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 418, 419, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 420, 419, 407, - 411, 411, 411, 411, 411, 411, 411, 407, 420, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - 411, 411, 411, 411, 411, 411, 411, 411, 411, 411, - - 411, 411, 411, 411, 411, 411, 0, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407 + 451, 1, 451, 451, 451, 452, 451, 453, 451, 451, + 451, 454, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 455, 455, + 455, 451, 451, 451, 451, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 451, 451, 451, 451, 451, 452, 451, 453, 451, + 453, 451, 451, 451, 451, 451, 451, 451, 454, 451, + 454, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 456, 451, 79, 21, 22, 451, 451, 451, 457, 451, + 451, 451, 451, 451, 451, 451, 451, 455, 455, 458, + + 459, 451, 451, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 460, 456, 451, 451, 451, 451, 451, 451, 451, + 457, 451, 451, 455, 458, 451, 458, 459, 451, 459, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + + 455, 455, 455, 461, 451, 451, 451, 451, 460, 451, + 451, 451, 451, 451, 451, 451, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 461, 451, 451, 451, 451, 451, 451, 451, 451, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + + 455, 455, 455, 455, 455, 455, 451, 451, 451, 451, + 451, 455, 455, 451, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 451, 451, 451, 455, 455, 451, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 462, 463, 455, + 455, 451, 451, 455, 455, 455, 455, 455, 455, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 464, 463, + 451, 455, 455, 451, 451, 455, 455, 455, 455, 455, + + 455, 455, 455, 451, 464, 455, 455, 451, 451, 455, + 455, 455, 455, 455, 455, 455, 455, 455, 451, 451, + 455, 455, 455, 455, 455, 455, 451, 451, 455, 455, + 455, 455, 455, 451, 451, 455, 455, 455, 455, 451, + 451, 455, 455, 451, 455, 455, 451, 455, 455, 455, + 0, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451 } ; -static yyconst flex_int16_t yy_nxt[699] = +static yyconst flex_int16_t yy_nxt[790] = { 0, 4, 5, 6, 5, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 22, 22, 22, 23, 24, 25, 26, 27, 28, - 29, 29, 29, 29, 29, 29, 30, 29, 29, 31, - 29, 29, 29, 29, 29, 29, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 29, 44, - 29, 45, 29, 29, 29, 29, 46, 47, 48, 49, - 50, 51, 29, 29, 29, 52, 53, 54, 55, 56, - 60, 56, 56, 62, 65, 66, 67, 70, 73, 132, - 78, 75, 79, 79, 79, 79, 79, 91, 96, 97, - - 80, 74, 76, 77, 68, 81, 85, 85, 85, 85, - 104, 112, 406, 92, 82, 93, 94, 106, 100, 107, - 113, 61, 101, 109, 71, 405, 114, 60, 115, 105, - 110, 117, 407, 63, 118, 120, 111, 116, 133, 183, - 155, 192, 121, 70, 64, 83, 184, 84, 84, 84, - 84, 85, 190, 124, 125, 56, 193, 56, 56, 407, - 149, 140, 86, 126, 140, 143, 127, 87, 61, 191, - 144, 407, 88, 89, 134, 134, 134, 134, 134, 147, - 71, 156, 149, 86, 148, 158, 141, 143, 196, 87, - 79, 79, 79, 79, 79, 144, 197, 88, 407, 209, - - 89, 147, 198, 211, 199, 138, 139, 404, 186, 148, - 139, 403, 148, 79, 79, 79, 79, 79, 187, 188, - 158, 209, 159, 261, 214, 211, 138, 139, 138, 139, - 215, 402, 139, 139, 145, 401, 145, 148, 155, 146, - 146, 146, 146, 146, 161, 261, 162, 201, 163, 138, - 139, 400, 164, 217, 218, 139, 165, 159, 264, 166, - 167, 168, 134, 134, 134, 134, 134, 204, 399, 204, - 230, 231, 205, 205, 205, 205, 205, 207, 208, 156, - 264, 398, 208, 146, 146, 146, 146, 146, 146, 146, - 146, 146, 146, 212, 301, 397, 396, 301, 213, 207, - - 303, 395, 263, 208, 210, 394, 302, 208, 210, 205, - 205, 205, 205, 205, 393, 212, 205, 205, 205, 205, - 205, 262, 303, 213, 392, 210, 263, 263, 391, 390, - 210, 389, 139, 388, 387, 386, 139, 378, 385, 384, - 383, 382, 381, 262, 380, 370, 378, 377, 376, 375, - 374, 263, 373, 139, 372, 371, 370, 367, 139, 57, - 57, 366, 57, 57, 57, 57, 59, 59, 59, 59, - 59, 59, 59, 69, 69, 69, 69, 69, 69, 69, - 98, 98, 98, 142, 142, 365, 142, 142, 142, 142, - 150, 150, 154, 154, 154, 154, 154, 154, 154, 157, - - 157, 157, 157, 157, 157, 157, 206, 364, 363, 206, - 206, 206, 256, 256, 256, 256, 256, 256, 256, 368, - 368, 369, 369, 369, 369, 369, 369, 369, 379, 379, - 379, 379, 362, 361, 360, 359, 358, 357, 356, 355, - 354, 353, 352, 351, 350, 349, 348, 347, 346, 345, - 344, 343, 342, 341, 340, 339, 338, 337, 336, 335, - 334, 333, 302, 332, 331, 330, 329, 328, 327, 326, - 325, 324, 323, 322, 321, 320, 319, 318, 317, 316, - 315, 314, 313, 312, 311, 310, 309, 308, 307, 306, - 305, 304, 300, 299, 257, 298, 297, 296, 295, 294, - - 293, 292, 291, 290, 289, 288, 287, 286, 285, 284, - 283, 282, 281, 280, 279, 278, 277, 276, 275, 274, - 273, 272, 271, 270, 269, 268, 267, 266, 265, 260, - 259, 258, 257, 255, 254, 253, 252, 251, 250, 249, - 248, 247, 246, 245, 244, 243, 242, 241, 240, 239, - 238, 237, 236, 235, 234, 233, 232, 229, 228, 227, - 226, 225, 224, 223, 222, 221, 220, 219, 216, 407, - 407, 141, 203, 202, 200, 195, 194, 189, 185, 182, - 181, 180, 179, 178, 177, 176, 175, 174, 173, 172, - 171, 170, 169, 160, 153, 152, 151, 137, 407, 136, - - 135, 407, 131, 130, 129, 128, 123, 122, 119, 108, - 103, 102, 99, 95, 90, 72, 58, 407, 3, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407 - + 22, 22, 22, 22, 22, 22, 22, 23, 24, 25, + 26, 27, 28, 29, 29, 29, 29, 29, 29, 30, + 29, 29, 31, 29, 29, 29, 29, 29, 29, 32, + 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 29, 44, 29, 45, 29, 29, 29, 29, 46, + 47, 48, 49, 50, 51, 29, 29, 29, 52, 53, + 54, 55, 56, 60, 56, 56, 62, 65, 66, 67, + 70, 73, 132, 78, 75, 79, 79, 79, 79, 79, + + 79, 79, 79, 91, 96, 97, 80, 74, 76, 77, + 68, 81, 100, 104, 450, 106, 101, 107, 60, 120, + 112, 109, 92, 82, 93, 94, 121, 61, 110, 113, + 71, 114, 105, 115, 111, 117, 124, 125, 118, 63, + 70, 133, 116, 156, 449, 56, 126, 56, 56, 127, + 64, 83, 150, 84, 84, 84, 84, 84, 84, 85, + 85, 159, 61, 134, 134, 134, 134, 134, 134, 134, + 134, 86, 140, 148, 150, 140, 87, 448, 149, 186, + 71, 88, 89, 189, 141, 193, 187, 157, 201, 199, + 202, 447, 86, 190, 191, 148, 195, 200, 87, 144, + + 142, 160, 194, 149, 145, 451, 88, 446, 156, 89, + 83, 196, 85, 85, 85, 85, 85, 85, 85, 85, + 217, 144, 159, 220, 221, 445, 218, 212, 210, 145, + 86, 149, 451, 211, 444, 87, 146, 214, 146, 211, + 88, 147, 147, 147, 147, 147, 147, 147, 147, 212, + 210, 86, 157, 235, 236, 443, 149, 87, 211, 214, + 266, 268, 160, 442, 211, 88, 79, 79, 79, 79, + 79, 79, 79, 79, 441, 162, 440, 163, 439, 164, + 204, 269, 266, 165, 138, 139, 268, 166, 311, 139, + 167, 168, 169, 170, 171, 134, 134, 134, 134, 134, + + 134, 134, 134, 269, 438, 138, 139, 207, 437, 207, + 311, 139, 208, 208, 208, 208, 208, 208, 208, 208, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 215, 267, 277, 436, + 309, 216, 268, 309, 435, 278, 314, 213, 314, 314, + 434, 213, 310, 314, 433, 314, 314, 432, 215, 267, + 373, 431, 373, 373, 430, 429, 216, 268, 213, 373, + 428, 373, 373, 213, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 427, 426, 425, 424, 423, 422, 421, 420, 315, 419, + + 418, 139, 417, 404, 416, 139, 415, 414, 413, 412, + 411, 410, 409, 408, 407, 406, 391, 404, 403, 402, + 401, 400, 139, 399, 398, 348, 397, 139, 396, 394, + 393, 392, 391, 388, 387, 386, 385, 384, 383, 382, + 381, 395, 57, 57, 380, 57, 57, 57, 57, 59, + 59, 59, 59, 59, 59, 59, 69, 69, 69, 69, + 69, 69, 69, 98, 98, 98, 143, 143, 379, 143, + 143, 143, 143, 151, 151, 155, 155, 155, 155, 155, + 155, 155, 158, 158, 158, 158, 158, 158, 158, 209, + 378, 377, 209, 209, 209, 261, 261, 261, 261, 261, + + 261, 261, 389, 389, 390, 390, 390, 390, 390, 390, + 390, 405, 405, 405, 405, 376, 375, 374, 372, 371, + 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, + 360, 359, 358, 357, 356, 355, 354, 353, 352, 351, + 350, 349, 347, 346, 345, 310, 344, 343, 342, 341, + 340, 339, 338, 337, 336, 335, 334, 333, 332, 331, + 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, + 320, 319, 318, 317, 316, 313, 312, 308, 307, 262, + 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, + 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, + + 286, 285, 284, 283, 282, 281, 280, 279, 276, 275, + 274, 273, 272, 271, 270, 265, 264, 263, 262, 260, + 259, 258, 257, 256, 255, 254, 253, 252, 251, 250, + 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, + 239, 238, 237, 234, 233, 232, 231, 230, 229, 228, + 227, 226, 225, 224, 223, 222, 219, 451, 451, 142, + 206, 205, 203, 198, 197, 192, 188, 185, 184, 183, + 182, 181, 180, 179, 178, 177, 176, 175, 174, 173, + 172, 161, 154, 153, 152, 137, 451, 136, 135, 451, + 131, 130, 129, 128, 123, 122, 119, 108, 103, 102, + + 99, 95, 90, 72, 58, 451, 3, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451 } ; -static yyconst flex_int16_t yy_chk[699] = +static yyconst flex_int16_t yy_chk[790] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -741,76 +773,85 @@ static yyconst flex_int16_t yy_chk[699] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, - 8, 5, 5, 9, 10, 10, 11, 12, 16, 53, - 19, 18, 19, 19, 19, 19, 19, 25, 27, 27, - - 20, 16, 18, 18, 11, 20, 22, 22, 22, 22, - 36, 40, 405, 25, 20, 25, 25, 37, 31, 37, - 40, 8, 31, 39, 12, 403, 41, 59, 41, 36, - 39, 42, 22, 9, 42, 44, 39, 41, 53, 121, - 100, 126, 44, 69, 9, 21, 121, 21, 21, 21, - 21, 21, 125, 47, 47, 56, 126, 56, 56, 22, - 88, 80, 21, 47, 80, 84, 47, 21, 59, 125, - 84, 84, 21, 21, 62, 62, 62, 62, 62, 87, - 69, 100, 88, 21, 87, 101, 80, 84, 129, 21, - 79, 79, 79, 79, 79, 84, 129, 21, 84, 144, - - 21, 87, 130, 149, 130, 79, 79, 402, 123, 87, - 79, 401, 147, 83, 83, 83, 83, 83, 123, 123, - 157, 144, 101, 209, 153, 149, 79, 79, 83, 83, - 153, 400, 79, 83, 86, 399, 86, 147, 154, 86, - 86, 86, 86, 86, 105, 209, 105, 134, 105, 83, - 83, 398, 105, 161, 161, 83, 105, 157, 213, 105, - 105, 105, 134, 134, 134, 134, 134, 138, 395, 138, - 174, 174, 138, 138, 138, 138, 138, 143, 207, 154, - 213, 394, 143, 145, 145, 145, 145, 145, 146, 146, - 146, 146, 146, 150, 260, 393, 392, 260, 150, 143, - - 264, 391, 262, 207, 146, 390, 260, 143, 146, 204, - 204, 204, 204, 204, 389, 150, 205, 205, 205, 205, - 205, 212, 264, 150, 388, 146, 212, 262, 387, 386, - 146, 383, 205, 382, 381, 380, 205, 379, 377, 376, - 374, 373, 372, 212, 371, 369, 368, 361, 360, 359, - 357, 212, 356, 205, 355, 354, 353, 351, 205, 408, - 408, 350, 408, 408, 408, 408, 409, 409, 409, 409, - 409, 409, 409, 410, 410, 410, 410, 410, 410, 410, - 411, 411, 411, 412, 412, 348, 412, 412, 412, 412, - 413, 413, 414, 414, 414, 414, 414, 414, 414, 415, - - 415, 415, 415, 415, 415, 415, 416, 347, 345, 416, - 416, 416, 417, 417, 417, 417, 417, 417, 417, 418, - 418, 419, 419, 419, 419, 419, 419, 419, 420, 420, - 420, 420, 344, 343, 342, 341, 340, 339, 337, 335, - 334, 332, 331, 330, 329, 328, 321, 320, 316, 315, - 314, 313, 312, 311, 310, 309, 308, 307, 306, 305, - 304, 302, 301, 300, 299, 297, 296, 294, 293, 292, - 291, 290, 289, 287, 286, 285, 284, 282, 281, 280, - 279, 276, 275, 274, 273, 272, 271, 270, 269, 268, - 266, 265, 259, 258, 256, 255, 254, 252, 251, 250, - - 249, 248, 247, 246, 245, 244, 243, 242, 241, 239, - 237, 236, 233, 232, 231, 230, 227, 225, 224, 223, - 222, 221, 220, 219, 218, 217, 216, 215, 214, 206, - 203, 202, 201, 200, 199, 198, 197, 196, 195, 194, - 193, 192, 191, 190, 189, 188, 187, 186, 185, 183, - 182, 180, 179, 178, 177, 176, 175, 173, 172, 171, - 170, 168, 167, 166, 165, 164, 163, 162, 160, 159, - 156, 140, 136, 135, 131, 128, 127, 124, 122, 119, - 118, 117, 116, 115, 114, 113, 112, 111, 110, 109, - 108, 107, 106, 104, 99, 97, 93, 78, 71, 64, - - 63, 61, 51, 50, 49, 48, 46, 45, 43, 38, - 35, 33, 30, 26, 23, 15, 7, 3, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407 - + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 5, 8, 5, 5, 9, 10, 10, 11, + 12, 16, 53, 19, 18, 19, 19, 19, 19, 19, + + 19, 19, 19, 25, 27, 27, 20, 16, 18, 18, + 11, 20, 31, 36, 449, 37, 31, 37, 59, 44, + 40, 39, 25, 20, 25, 25, 44, 8, 39, 40, + 12, 41, 36, 41, 39, 42, 47, 47, 42, 9, + 69, 53, 41, 100, 446, 56, 47, 56, 56, 47, + 9, 21, 88, 21, 21, 21, 21, 21, 21, 21, + 21, 101, 59, 62, 62, 62, 62, 62, 62, 62, + 62, 21, 80, 87, 88, 80, 21, 445, 87, 121, + 69, 21, 21, 123, 80, 125, 121, 100, 130, 129, + 130, 444, 21, 123, 123, 87, 126, 129, 21, 84, + + 80, 101, 125, 87, 84, 84, 21, 443, 155, 21, + 22, 126, 22, 22, 22, 22, 22, 22, 22, 22, + 154, 84, 158, 162, 162, 442, 154, 145, 144, 84, + 22, 148, 84, 144, 441, 22, 86, 150, 86, 210, + 22, 86, 86, 86, 86, 86, 86, 86, 86, 145, + 144, 22, 155, 177, 177, 439, 148, 22, 144, 150, + 212, 267, 158, 438, 210, 22, 79, 79, 79, 79, + 79, 79, 79, 79, 435, 105, 434, 105, 433, 105, + 134, 216, 212, 105, 79, 79, 267, 105, 269, 79, + 105, 105, 105, 105, 105, 134, 134, 134, 134, 134, + + 134, 134, 134, 216, 432, 79, 79, 138, 430, 138, + 269, 79, 138, 138, 138, 138, 138, 138, 138, 138, + 146, 146, 146, 146, 146, 146, 146, 146, 147, 147, + 147, 147, 147, 147, 147, 147, 151, 215, 224, 429, + 265, 151, 215, 265, 428, 224, 273, 147, 273, 273, + 427, 147, 265, 314, 426, 314, 314, 425, 151, 215, + 349, 424, 349, 349, 422, 421, 151, 215, 147, 373, + 420, 373, 373, 147, 207, 207, 207, 207, 207, 207, + 207, 207, 208, 208, 208, 208, 208, 208, 208, 208, + 419, 418, 417, 416, 415, 411, 410, 409, 273, 408, + + 407, 208, 406, 405, 403, 208, 402, 401, 400, 398, + 397, 396, 395, 394, 393, 392, 390, 389, 383, 382, + 380, 379, 208, 378, 377, 314, 375, 208, 374, 372, + 371, 370, 369, 367, 366, 364, 363, 361, 360, 359, + 358, 373, 452, 452, 357, 452, 452, 452, 452, 453, + 453, 453, 453, 453, 453, 453, 454, 454, 454, 454, + 454, 454, 454, 455, 455, 455, 456, 456, 356, 456, + 456, 456, 456, 457, 457, 458, 458, 458, 458, 458, + 458, 458, 459, 459, 459, 459, 459, 459, 459, 460, + 355, 354, 460, 460, 460, 461, 461, 461, 461, 461, + + 461, 461, 462, 462, 463, 463, 463, 463, 463, 463, + 463, 464, 464, 464, 464, 353, 352, 350, 348, 347, + 346, 344, 343, 342, 341, 340, 333, 332, 328, 327, + 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, + 316, 315, 313, 312, 310, 309, 308, 307, 305, 304, + 302, 301, 300, 299, 298, 297, 295, 294, 293, 292, + 290, 289, 288, 287, 284, 283, 282, 281, 280, 279, + 278, 277, 276, 275, 274, 271, 270, 264, 263, 261, + 260, 259, 257, 256, 255, 254, 253, 252, 251, 250, + 249, 248, 247, 246, 244, 242, 241, 238, 237, 236, + + 235, 232, 230, 229, 228, 227, 226, 225, 223, 222, + 221, 220, 219, 218, 217, 209, 206, 205, 204, 203, + 202, 201, 200, 199, 198, 197, 196, 195, 194, 193, + 192, 191, 190, 189, 188, 186, 185, 183, 182, 181, + 180, 179, 178, 176, 175, 174, 173, 171, 170, 169, + 168, 167, 166, 165, 164, 163, 161, 160, 157, 140, + 136, 135, 131, 128, 127, 124, 122, 119, 118, 117, + 116, 115, 114, 113, 112, 111, 110, 109, 108, 107, + 106, 104, 99, 97, 93, 78, 71, 64, 63, 61, + 51, 50, 49, 48, 46, 45, 43, 38, 35, 33, + + 30, 26, 23, 15, 7, 3, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451, 451, + 451, 451, 451, 451, 451, 451, 451, 451, 451 } ; extern int yy_flex_debug; @@ -879,12 +920,13 @@ char linebuf[2000]; extern int yylex (GISourceScanner *scanner); #define YY_DECL int yylex (GISourceScanner *scanner) static int yywrap (void); +static void parse_gtk_doc_comment (GISourceScanner *scanner); static void parse_comment (GISourceScanner *scanner); static void parse_trigraph (GISourceScanner *scanner); static void process_linemarks (GISourceScanner *scanner); static int check_identifier (GISourceScanner *scanner, const char *); static int parse_ignored_macro (void); -#line 888 "scannerlexer.c" +#line 930 "scannerlexer.c" #define INITIAL 0 @@ -1064,10 +1106,10 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 65 "giscanner/scannerlexer.l" +#line 66 "giscanner/scannerlexer.l" -#line 1071 "scannerlexer.c" +#line 1113 "scannerlexer.c" if ( !(yy_init) ) { @@ -1125,14 +1167,14 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 408 ) + if ( yy_current_state >= 452 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; *(yy_state_ptr)++ = yy_current_state; ++yy_cp; } - while ( yy_base[yy_current_state] != 619 ); + while ( yy_base[yy_current_state] != 707 ); yy_find_action: yy_current_state = *--(yy_state_ptr); @@ -1162,7 +1204,7 @@ do_action: /* This label is used only to access EOF actions. */ case 1: /* rule 1 can match eol */ YY_RULE_SETUP -#line 67 "giscanner/scannerlexer.l" +#line 68 "giscanner/scannerlexer.l" { strncpy(linebuf, yytext+1, sizeof(linebuf)); /* save the next line */ linebuf[sizeof(linebuf)-1]='\0'; /* printf("%4d:%s\n",lineno,linebuf); */ @@ -1173,380 +1215,380 @@ YY_RULE_SETUP case 2: /* rule 2 can match eol */ YY_RULE_SETUP -#line 73 "giscanner/scannerlexer.l" +#line 74 "giscanner/scannerlexer.l" { ++lineno; } YY_BREAK case 3: YY_RULE_SETUP -#line 74 "giscanner/scannerlexer.l" +#line 76 "giscanner/scannerlexer.l" { /* Ignore whitespace. */ } YY_BREAK case 4: YY_RULE_SETUP -#line 76 "giscanner/scannerlexer.l" -{ parse_comment(scanner); } +#line 78 "giscanner/scannerlexer.l" +{ parse_gtk_doc_comment(scanner); } YY_BREAK case 5: YY_RULE_SETUP -#line 77 "giscanner/scannerlexer.l" -{ parse_trigraph(scanner); } +#line 79 "giscanner/scannerlexer.l" +{ parse_comment(scanner); } YY_BREAK case 6: YY_RULE_SETUP -#line 78 "giscanner/scannerlexer.l" -{ /* Ignore C++ style comments. */ } +#line 80 "giscanner/scannerlexer.l" +{ parse_trigraph(scanner); } YY_BREAK case 7: YY_RULE_SETUP -#line 80 "giscanner/scannerlexer.l" -{ yyless (yyleng - 1); return FUNCTION_MACRO; } +#line 81 "giscanner/scannerlexer.l" +{ /* Ignore C++ style comments. */ } YY_BREAK case 8: YY_RULE_SETUP -#line 81 "giscanner/scannerlexer.l" -{ return OBJECT_MACRO; } +#line 83 "giscanner/scannerlexer.l" +{ yyless (yyleng - 1); return FUNCTION_MACRO; } YY_BREAK case 9: -/* rule 9 can match eol */ YY_RULE_SETUP -#line 82 "giscanner/scannerlexer.l" -{ /* Ignore pragma. */ } +#line 84 "giscanner/scannerlexer.l" +{ return OBJECT_MACRO; } YY_BREAK case 10: /* rule 10 can match eol */ YY_RULE_SETUP -#line 84 "giscanner/scannerlexer.l" -{ process_linemarks(scanner); } +#line 85 "giscanner/scannerlexer.l" +{ /* Ignore pragma. */ } YY_BREAK case 11: +/* rule 11 can match eol */ YY_RULE_SETUP -#line 85 "giscanner/scannerlexer.l" -{ } +#line 87 "giscanner/scannerlexer.l" +{ process_linemarks(scanner); } YY_BREAK case 12: YY_RULE_SETUP -#line 86 "giscanner/scannerlexer.l" -{ return '{'; } +#line 88 "giscanner/scannerlexer.l" +{ } YY_BREAK case 13: YY_RULE_SETUP -#line 87 "giscanner/scannerlexer.l" +#line 89 "giscanner/scannerlexer.l" { return '{'; } YY_BREAK case 14: YY_RULE_SETUP -#line 88 "giscanner/scannerlexer.l" -{ return '}'; } +#line 90 "giscanner/scannerlexer.l" +{ return '{'; } YY_BREAK case 15: YY_RULE_SETUP -#line 89 "giscanner/scannerlexer.l" +#line 91 "giscanner/scannerlexer.l" { return '}'; } YY_BREAK case 16: YY_RULE_SETUP -#line 90 "giscanner/scannerlexer.l" -{ return '['; } +#line 92 "giscanner/scannerlexer.l" +{ return '}'; } YY_BREAK case 17: YY_RULE_SETUP -#line 91 "giscanner/scannerlexer.l" +#line 93 "giscanner/scannerlexer.l" { return '['; } YY_BREAK case 18: YY_RULE_SETUP -#line 92 "giscanner/scannerlexer.l" -{ return ']'; } +#line 94 "giscanner/scannerlexer.l" +{ return '['; } YY_BREAK case 19: YY_RULE_SETUP -#line 93 "giscanner/scannerlexer.l" +#line 95 "giscanner/scannerlexer.l" { return ']'; } YY_BREAK case 20: YY_RULE_SETUP -#line 94 "giscanner/scannerlexer.l" -{ return '('; } +#line 96 "giscanner/scannerlexer.l" +{ return ']'; } YY_BREAK case 21: YY_RULE_SETUP -#line 95 "giscanner/scannerlexer.l" -{ return ')'; } +#line 97 "giscanner/scannerlexer.l" +{ return '('; } YY_BREAK case 22: YY_RULE_SETUP -#line 96 "giscanner/scannerlexer.l" -{ return ';'; } +#line 98 "giscanner/scannerlexer.l" +{ return ')'; } YY_BREAK case 23: YY_RULE_SETUP -#line 97 "giscanner/scannerlexer.l" -{ return ':'; } +#line 99 "giscanner/scannerlexer.l" +{ return ';'; } YY_BREAK case 24: YY_RULE_SETUP -#line 98 "giscanner/scannerlexer.l" -{ return ELLIPSIS; } +#line 100 "giscanner/scannerlexer.l" +{ return ':'; } YY_BREAK case 25: YY_RULE_SETUP -#line 99 "giscanner/scannerlexer.l" -{ return '?'; } +#line 101 "giscanner/scannerlexer.l" +{ return ELLIPSIS; } YY_BREAK case 26: YY_RULE_SETUP -#line 100 "giscanner/scannerlexer.l" -{ return '.'; } +#line 102 "giscanner/scannerlexer.l" +{ return '?'; } YY_BREAK case 27: YY_RULE_SETUP -#line 101 "giscanner/scannerlexer.l" -{ return '+'; } +#line 103 "giscanner/scannerlexer.l" +{ return '.'; } YY_BREAK case 28: YY_RULE_SETUP -#line 102 "giscanner/scannerlexer.l" -{ return '-'; } +#line 104 "giscanner/scannerlexer.l" +{ return '+'; } YY_BREAK case 29: YY_RULE_SETUP -#line 103 "giscanner/scannerlexer.l" -{ return '*'; } +#line 105 "giscanner/scannerlexer.l" +{ return '-'; } YY_BREAK case 30: YY_RULE_SETUP -#line 104 "giscanner/scannerlexer.l" -{ return '/'; } +#line 106 "giscanner/scannerlexer.l" +{ return '*'; } YY_BREAK case 31: YY_RULE_SETUP -#line 105 "giscanner/scannerlexer.l" -{ return '%'; } +#line 107 "giscanner/scannerlexer.l" +{ return '/'; } YY_BREAK case 32: YY_RULE_SETUP -#line 106 "giscanner/scannerlexer.l" -{ return '^'; } +#line 108 "giscanner/scannerlexer.l" +{ return '%'; } YY_BREAK case 33: YY_RULE_SETUP -#line 107 "giscanner/scannerlexer.l" -{ return '&'; } +#line 109 "giscanner/scannerlexer.l" +{ return '^'; } YY_BREAK case 34: YY_RULE_SETUP -#line 108 "giscanner/scannerlexer.l" -{ return '|'; } +#line 110 "giscanner/scannerlexer.l" +{ return '&'; } YY_BREAK case 35: YY_RULE_SETUP -#line 109 "giscanner/scannerlexer.l" -{ return '~'; } +#line 111 "giscanner/scannerlexer.l" +{ return '|'; } YY_BREAK case 36: YY_RULE_SETUP -#line 110 "giscanner/scannerlexer.l" -{ return '!'; } +#line 112 "giscanner/scannerlexer.l" +{ return '~'; } YY_BREAK case 37: YY_RULE_SETUP -#line 111 "giscanner/scannerlexer.l" -{ return '='; } +#line 113 "giscanner/scannerlexer.l" +{ return '!'; } YY_BREAK case 38: YY_RULE_SETUP -#line 112 "giscanner/scannerlexer.l" -{ return '<'; } +#line 114 "giscanner/scannerlexer.l" +{ return '='; } YY_BREAK case 39: YY_RULE_SETUP -#line 113 "giscanner/scannerlexer.l" -{ return '>'; } +#line 115 "giscanner/scannerlexer.l" +{ return '<'; } YY_BREAK case 40: YY_RULE_SETUP -#line 114 "giscanner/scannerlexer.l" -{ return ADDEQ; } +#line 116 "giscanner/scannerlexer.l" +{ return '>'; } YY_BREAK case 41: YY_RULE_SETUP -#line 115 "giscanner/scannerlexer.l" -{ return SUBEQ; } +#line 117 "giscanner/scannerlexer.l" +{ return ADDEQ; } YY_BREAK case 42: YY_RULE_SETUP -#line 116 "giscanner/scannerlexer.l" -{ return MULEQ; } +#line 118 "giscanner/scannerlexer.l" +{ return SUBEQ; } YY_BREAK case 43: YY_RULE_SETUP -#line 117 "giscanner/scannerlexer.l" -{ return DIVEQ; } +#line 119 "giscanner/scannerlexer.l" +{ return MULEQ; } YY_BREAK case 44: YY_RULE_SETUP -#line 118 "giscanner/scannerlexer.l" -{ return MODEQ; } +#line 120 "giscanner/scannerlexer.l" +{ return DIVEQ; } YY_BREAK case 45: YY_RULE_SETUP -#line 119 "giscanner/scannerlexer.l" -{ return XOREQ; } +#line 121 "giscanner/scannerlexer.l" +{ return MODEQ; } YY_BREAK case 46: YY_RULE_SETUP -#line 120 "giscanner/scannerlexer.l" -{ return ANDEQ; } +#line 122 "giscanner/scannerlexer.l" +{ return XOREQ; } YY_BREAK case 47: YY_RULE_SETUP -#line 121 "giscanner/scannerlexer.l" -{ return OREQ; } +#line 123 "giscanner/scannerlexer.l" +{ return ANDEQ; } YY_BREAK case 48: YY_RULE_SETUP -#line 122 "giscanner/scannerlexer.l" -{ return SL; } +#line 124 "giscanner/scannerlexer.l" +{ return OREQ; } YY_BREAK case 49: YY_RULE_SETUP -#line 123 "giscanner/scannerlexer.l" -{ return SR; } +#line 125 "giscanner/scannerlexer.l" +{ return SL; } YY_BREAK case 50: YY_RULE_SETUP -#line 124 "giscanner/scannerlexer.l" -{ return SLEQ; } +#line 126 "giscanner/scannerlexer.l" +{ return SR; } YY_BREAK case 51: YY_RULE_SETUP -#line 125 "giscanner/scannerlexer.l" -{ return SREQ; } +#line 127 "giscanner/scannerlexer.l" +{ return SLEQ; } YY_BREAK case 52: YY_RULE_SETUP -#line 126 "giscanner/scannerlexer.l" -{ return EQ; } +#line 128 "giscanner/scannerlexer.l" +{ return SREQ; } YY_BREAK case 53: YY_RULE_SETUP -#line 127 "giscanner/scannerlexer.l" -{ return NOTEQ; } +#line 129 "giscanner/scannerlexer.l" +{ return EQ; } YY_BREAK case 54: YY_RULE_SETUP -#line 128 "giscanner/scannerlexer.l" -{ return LTEQ; } +#line 130 "giscanner/scannerlexer.l" +{ return NOTEQ; } YY_BREAK case 55: YY_RULE_SETUP -#line 129 "giscanner/scannerlexer.l" -{ return GTEQ; } +#line 131 "giscanner/scannerlexer.l" +{ return LTEQ; } YY_BREAK case 56: YY_RULE_SETUP -#line 130 "giscanner/scannerlexer.l" -{ return ANDAND; } +#line 132 "giscanner/scannerlexer.l" +{ return GTEQ; } YY_BREAK case 57: YY_RULE_SETUP -#line 131 "giscanner/scannerlexer.l" -{ return OROR; } +#line 133 "giscanner/scannerlexer.l" +{ return ANDAND; } YY_BREAK case 58: YY_RULE_SETUP -#line 132 "giscanner/scannerlexer.l" -{ return PLUSPLUS; } +#line 134 "giscanner/scannerlexer.l" +{ return OROR; } YY_BREAK case 59: YY_RULE_SETUP -#line 133 "giscanner/scannerlexer.l" -{ return MINUSMINUS; } +#line 135 "giscanner/scannerlexer.l" +{ return PLUSPLUS; } YY_BREAK case 60: YY_RULE_SETUP -#line 134 "giscanner/scannerlexer.l" -{ return ','; } +#line 136 "giscanner/scannerlexer.l" +{ return MINUSMINUS; } YY_BREAK case 61: YY_RULE_SETUP -#line 135 "giscanner/scannerlexer.l" -{ return ARROW; } +#line 137 "giscanner/scannerlexer.l" +{ return ','; } YY_BREAK case 62: YY_RULE_SETUP -#line 137 "giscanner/scannerlexer.l" -{ if (!parse_ignored_macro()) REJECT; } +#line 138 "giscanner/scannerlexer.l" +{ return ARROW; } YY_BREAK case 63: YY_RULE_SETUP -#line 138 "giscanner/scannerlexer.l" +#line 140 "giscanner/scannerlexer.l" { if (!parse_ignored_macro()) REJECT; } YY_BREAK case 64: YY_RULE_SETUP -#line 139 "giscanner/scannerlexer.l" +#line 141 "giscanner/scannerlexer.l" { if (!parse_ignored_macro()) REJECT; } YY_BREAK case 65: YY_RULE_SETUP -#line 140 "giscanner/scannerlexer.l" +#line 142 "giscanner/scannerlexer.l" { if (!parse_ignored_macro()) REJECT; } YY_BREAK case 66: YY_RULE_SETUP -#line 141 "giscanner/scannerlexer.l" -{ return CONST; } +#line 143 "giscanner/scannerlexer.l" +{ if (!parse_ignored_macro()) REJECT; } YY_BREAK case 67: YY_RULE_SETUP -#line 142 "giscanner/scannerlexer.l" -{ return EXTENSION; } +#line 144 "giscanner/scannerlexer.l" +{ if (!parse_ignored_macro()) REJECT; } YY_BREAK case 68: YY_RULE_SETUP -#line 143 "giscanner/scannerlexer.l" -{ return INLINE; } +#line 145 "giscanner/scannerlexer.l" +{ if (!parse_ignored_macro()) REJECT; } YY_BREAK case 69: YY_RULE_SETUP -#line 144 "giscanner/scannerlexer.l" -{ if (!parse_ignored_macro()) REJECT; } +#line 146 "giscanner/scannerlexer.l" +{ return CONST; } YY_BREAK case 70: YY_RULE_SETUP -#line 145 "giscanner/scannerlexer.l" -{ return SIGNED; } +#line 147 "giscanner/scannerlexer.l" +{ return EXTENSION; } YY_BREAK case 71: YY_RULE_SETUP -#line 146 "giscanner/scannerlexer.l" -{ return RESTRICT; } +#line 148 "giscanner/scannerlexer.l" +{ return INLINE; } YY_BREAK case 72: YY_RULE_SETUP -#line 147 "giscanner/scannerlexer.l" +#line 149 "giscanner/scannerlexer.l" { if (!parse_ignored_macro()) REJECT; } YY_BREAK case 73: YY_RULE_SETUP -#line 148 "giscanner/scannerlexer.l" -{ return BOOL; } +#line 150 "giscanner/scannerlexer.l" +{ return SIGNED; } YY_BREAK case 74: YY_RULE_SETUP -#line 150 "giscanner/scannerlexer.l" -{ return INTL_CONST; } +#line 151 "giscanner/scannerlexer.l" +{ return RESTRICT; } YY_BREAK case 75: YY_RULE_SETUP -#line 151 "giscanner/scannerlexer.l" -{ return INTUL_CONST; } +#line 152 "giscanner/scannerlexer.l" +{ if (!parse_ignored_macro()) REJECT; } YY_BREAK case 76: YY_RULE_SETUP -#line 152 "giscanner/scannerlexer.l" -{ if (scanner->macro_scan) return check_identifier(scanner, yytext); else REJECT; } +#line 153 "giscanner/scannerlexer.l" +{ if (!parse_ignored_macro()) REJECT; } YY_BREAK case 77: YY_RULE_SETUP @@ -1556,238 +1598,283 @@ YY_RULE_SETUP case 78: YY_RULE_SETUP #line 155 "giscanner/scannerlexer.l" -{ return AUTO; } +{ return BOOL; } YY_BREAK case 79: YY_RULE_SETUP -#line 156 "giscanner/scannerlexer.l" -{ return BREAK; } +#line 157 "giscanner/scannerlexer.l" +{ return INTL_CONST; } YY_BREAK case 80: YY_RULE_SETUP -#line 157 "giscanner/scannerlexer.l" -{ return CASE; } +#line 158 "giscanner/scannerlexer.l" +{ return INTUL_CONST; } YY_BREAK case 81: YY_RULE_SETUP -#line 158 "giscanner/scannerlexer.l" -{ return CHAR; } +#line 159 "giscanner/scannerlexer.l" +{ if (scanner->macro_scan) return check_identifier(scanner, yytext); else REJECT; } YY_BREAK case 82: YY_RULE_SETUP -#line 159 "giscanner/scannerlexer.l" -{ return CONST; } +#line 161 "giscanner/scannerlexer.l" +{ if (!parse_ignored_macro()) REJECT; } YY_BREAK case 83: YY_RULE_SETUP -#line 160 "giscanner/scannerlexer.l" -{ return CONTINUE; } +#line 162 "giscanner/scannerlexer.l" +{ return AUTO; } YY_BREAK case 84: YY_RULE_SETUP -#line 161 "giscanner/scannerlexer.l" -{ return DEFAULT; } +#line 163 "giscanner/scannerlexer.l" +{ return BREAK; } YY_BREAK case 85: YY_RULE_SETUP -#line 162 "giscanner/scannerlexer.l" -{ return DO; } +#line 164 "giscanner/scannerlexer.l" +{ return CASE; } YY_BREAK case 86: YY_RULE_SETUP -#line 163 "giscanner/scannerlexer.l" -{ return DOUBLE; } +#line 165 "giscanner/scannerlexer.l" +{ return CHAR; } YY_BREAK case 87: YY_RULE_SETUP -#line 164 "giscanner/scannerlexer.l" -{ return ELSE; } +#line 166 "giscanner/scannerlexer.l" +{ return CONST; } YY_BREAK case 88: YY_RULE_SETUP -#line 165 "giscanner/scannerlexer.l" -{ return ENUM; } +#line 167 "giscanner/scannerlexer.l" +{ return CONTINUE; } YY_BREAK case 89: YY_RULE_SETUP -#line 166 "giscanner/scannerlexer.l" -{ return EXTERN; } +#line 168 "giscanner/scannerlexer.l" +{ return DEFAULT; } YY_BREAK case 90: YY_RULE_SETUP -#line 167 "giscanner/scannerlexer.l" -{ return FLOAT; } +#line 169 "giscanner/scannerlexer.l" +{ return DO; } YY_BREAK case 91: YY_RULE_SETUP -#line 168 "giscanner/scannerlexer.l" -{ return FOR; } +#line 170 "giscanner/scannerlexer.l" +{ return DOUBLE; } YY_BREAK case 92: YY_RULE_SETUP -#line 169 "giscanner/scannerlexer.l" -{ return GOTO; } +#line 171 "giscanner/scannerlexer.l" +{ return ELSE; } YY_BREAK case 93: YY_RULE_SETUP -#line 170 "giscanner/scannerlexer.l" -{ return IF; } +#line 172 "giscanner/scannerlexer.l" +{ return ENUM; } YY_BREAK case 94: YY_RULE_SETUP -#line 171 "giscanner/scannerlexer.l" -{ return INLINE; } +#line 173 "giscanner/scannerlexer.l" +{ return EXTERN; } YY_BREAK case 95: YY_RULE_SETUP -#line 172 "giscanner/scannerlexer.l" -{ return INT; } +#line 174 "giscanner/scannerlexer.l" +{ return FLOAT; } YY_BREAK case 96: YY_RULE_SETUP -#line 173 "giscanner/scannerlexer.l" -{ return LONG; } +#line 175 "giscanner/scannerlexer.l" +{ return FOR; } YY_BREAK case 97: YY_RULE_SETUP -#line 174 "giscanner/scannerlexer.l" -{ return REGISTER; } +#line 176 "giscanner/scannerlexer.l" +{ return GOTO; } YY_BREAK case 98: YY_RULE_SETUP -#line 175 "giscanner/scannerlexer.l" -{ return RESTRICT; } +#line 177 "giscanner/scannerlexer.l" +{ return IF; } YY_BREAK case 99: YY_RULE_SETUP -#line 176 "giscanner/scannerlexer.l" -{ return RETURN; } +#line 178 "giscanner/scannerlexer.l" +{ return INLINE; } YY_BREAK case 100: YY_RULE_SETUP -#line 177 "giscanner/scannerlexer.l" -{ return SHORT; } +#line 179 "giscanner/scannerlexer.l" +{ return INT; } YY_BREAK case 101: YY_RULE_SETUP -#line 178 "giscanner/scannerlexer.l" -{ return SIGNED; } +#line 180 "giscanner/scannerlexer.l" +{ return INT; } YY_BREAK case 102: YY_RULE_SETUP -#line 179 "giscanner/scannerlexer.l" -{ return SIZEOF; } +#line 181 "giscanner/scannerlexer.l" +{ return INT; } YY_BREAK case 103: YY_RULE_SETUP -#line 180 "giscanner/scannerlexer.l" -{ return STATIC; } +#line 182 "giscanner/scannerlexer.l" +{ return INT; } YY_BREAK case 104: YY_RULE_SETUP -#line 181 "giscanner/scannerlexer.l" -{ return STRUCT; } +#line 183 "giscanner/scannerlexer.l" +{ return INT; } YY_BREAK case 105: YY_RULE_SETUP -#line 182 "giscanner/scannerlexer.l" -{ return SWITCH; } +#line 184 "giscanner/scannerlexer.l" +{ return LONG; } YY_BREAK case 106: YY_RULE_SETUP -#line 183 "giscanner/scannerlexer.l" -{ return TYPEDEF; } +#line 185 "giscanner/scannerlexer.l" +{ return REGISTER; } YY_BREAK case 107: YY_RULE_SETUP -#line 184 "giscanner/scannerlexer.l" -{ return UNION; } +#line 186 "giscanner/scannerlexer.l" +{ return RESTRICT; } YY_BREAK case 108: YY_RULE_SETUP -#line 185 "giscanner/scannerlexer.l" -{ return UNSIGNED; } +#line 187 "giscanner/scannerlexer.l" +{ return RETURN; } YY_BREAK case 109: YY_RULE_SETUP -#line 186 "giscanner/scannerlexer.l" -{ return VOID; } +#line 188 "giscanner/scannerlexer.l" +{ return SHORT; } YY_BREAK case 110: YY_RULE_SETUP -#line 187 "giscanner/scannerlexer.l" -{ return VOLATILE; } +#line 189 "giscanner/scannerlexer.l" +{ return SIGNED; } YY_BREAK case 111: YY_RULE_SETUP -#line 188 "giscanner/scannerlexer.l" -{ return WHILE; } +#line 190 "giscanner/scannerlexer.l" +{ return SIZEOF; } YY_BREAK case 112: YY_RULE_SETUP -#line 190 "giscanner/scannerlexer.l" -{ return check_identifier(scanner, yytext); } +#line 191 "giscanner/scannerlexer.l" +{ return STATIC; } YY_BREAK case 113: YY_RULE_SETUP #line 192 "giscanner/scannerlexer.l" -{ return INTEGER; } +{ return STRUCT; } YY_BREAK case 114: YY_RULE_SETUP #line 193 "giscanner/scannerlexer.l" -{ return INTEGER; } +{ return SWITCH; } YY_BREAK case 115: YY_RULE_SETUP #line 194 "giscanner/scannerlexer.l" -{ return INTEGER; } +{ return TYPEDEF; } YY_BREAK case 116: YY_RULE_SETUP -#line 196 "giscanner/scannerlexer.l" -{ return FLOATING; } +#line 195 "giscanner/scannerlexer.l" +{ return UNION; } YY_BREAK case 117: YY_RULE_SETUP -#line 197 "giscanner/scannerlexer.l" -{ return FLOATING; } +#line 196 "giscanner/scannerlexer.l" +{ return UNSIGNED; } YY_BREAK case 118: -/* rule 118 can match eol */ YY_RULE_SETUP -#line 199 "giscanner/scannerlexer.l" -{ return CHARACTER; } +#line 197 "giscanner/scannerlexer.l" +{ return VOID; } YY_BREAK case 119: -/* rule 119 can match eol */ YY_RULE_SETUP -#line 200 "giscanner/scannerlexer.l" -{ return CHARACTER; } +#line 198 "giscanner/scannerlexer.l" +{ return VOLATILE; } YY_BREAK case 120: -/* rule 120 can match eol */ YY_RULE_SETUP -#line 202 "giscanner/scannerlexer.l" -{ return STRING; } +#line 199 "giscanner/scannerlexer.l" +{ return WHILE; } YY_BREAK case 121: -/* rule 121 can match eol */ YY_RULE_SETUP -#line 203 "giscanner/scannerlexer.l" -{ return STRING; } +#line 201 "giscanner/scannerlexer.l" +{ return check_identifier(scanner, yytext); } YY_BREAK case 122: YY_RULE_SETUP -#line 205 "giscanner/scannerlexer.l" -{ if (yytext[0]) fprintf(stderr, "%s:%d: unexpected character `%c'\n", scanner->current_filename, lineno, yytext[0]); } +#line 203 "giscanner/scannerlexer.l" +{ return INTEGER; } YY_BREAK case 123: YY_RULE_SETUP +#line 204 "giscanner/scannerlexer.l" +{ return INTEGER; } + YY_BREAK +case 124: +YY_RULE_SETUP +#line 205 "giscanner/scannerlexer.l" +{ return INTEGER; } + YY_BREAK +case 125: +YY_RULE_SETUP #line 207 "giscanner/scannerlexer.l" +{ return FLOATING; } + YY_BREAK +case 126: +YY_RULE_SETUP +#line 208 "giscanner/scannerlexer.l" +{ return FLOATING; } + YY_BREAK +case 127: +/* rule 127 can match eol */ +YY_RULE_SETUP +#line 210 "giscanner/scannerlexer.l" +{ return CHARACTER; } + YY_BREAK +case 128: +/* rule 128 can match eol */ +YY_RULE_SETUP +#line 211 "giscanner/scannerlexer.l" +{ return CHARACTER; } + YY_BREAK +case 129: +/* rule 129 can match eol */ +YY_RULE_SETUP +#line 213 "giscanner/scannerlexer.l" +{ return STRING; } + YY_BREAK +case 130: +/* rule 130 can match eol */ +YY_RULE_SETUP +#line 214 "giscanner/scannerlexer.l" +{ return STRING; } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 216 "giscanner/scannerlexer.l" +{ if (yytext[0]) fprintf(stderr, "%s:%d: unexpected character `%c'\n", scanner->current_filename, lineno, yytext[0]); } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 218 "giscanner/scannerlexer.l" ECHO; YY_BREAK -#line 1791 "scannerlexer.c" +#line 1878 "scannerlexer.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2048,7 +2135,7 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 408 ) + if ( yy_current_state >= 452 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2071,11 +2158,11 @@ static int yy_get_next_buffer (void) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 408 ) + if ( yy_current_state >= 452 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 407); + yy_is_jam = (yy_current_state == 451); if ( ! yy_is_jam ) *(yy_state_ptr)++ = yy_current_state; @@ -2718,7 +2805,7 @@ void yyfree (void * ptr ) #define YYTABLES_NAME "yytables" -#line 207 "giscanner/scannerlexer.l" +#line 218 "giscanner/scannerlexer.l" @@ -2728,9 +2815,8 @@ yywrap (void) return 1; } - static void -parse_comment (GISourceScanner *scanner) +parse_gtk_doc_comment (GISourceScanner *scanner) { GString *string = NULL; int c1, c2; @@ -2743,7 +2829,7 @@ parse_comment (GISourceScanner *scanner) (GCompareFunc)g_strcmp0)) { skip = TRUE; } else { - string = g_string_new ("/*"); + string = g_string_new (yytext); } c1 = input(); @@ -2778,6 +2864,26 @@ parse_comment (GISourceScanner *scanner) comment); } +static void +parse_comment (GISourceScanner *scanner) +{ + int c1, c2; + + c1 = input(); + c2 = input(); + + while (c2 != EOF && !(c1 == '*' && c2 == '/')) + { + if (c1 == '\n') + lineno++; + + c1 = c2; + c2 = input(); + } + + return; +} + static int check_identifier (GISourceScanner *scanner, const char *s) diff --git a/scannerparser.c b/scannerparser.c index 6f4575b..c7ee1ff 100644 --- a/scannerparser.c +++ b/scannerparser.c @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.6.1. */ +/* A Bison parser, made by GNU Bison 2.6.4. */ /* Bison implementation for Yacc-like parsers in C @@ -44,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.6.1" +#define YYBISON_VERSION "2.6.4" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -62,7 +62,7 @@ /* Copy the first part of user declarations. */ -/* Line 336 of yacc.c */ +/* Line 358 of yacc.c */ #line 29 "giscanner/scannerparser.y" #include @@ -167,7 +167,7 @@ out: } -/* Line 336 of yacc.c */ +/* Line 358 of yacc.c */ #line 172 "scannerparser.c" # ifndef YY_NULL @@ -188,8 +188,8 @@ out: /* In a future release of Bison, this section will be replaced by #include "y.tab.h". */ -#ifndef YY_SCANNERPARSER_H -# define YY_SCANNERPARSER_H +#ifndef YY_YY_SCANNERPARSER_H_INCLUDED +# define YY_YY_SCANNERPARSER_H_INCLUDED /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 1 @@ -349,7 +349,7 @@ extern int yydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 350 of yacc.c */ +/* Line 374 of yacc.c */ #line 134 "giscanner/scannerparser.y" char *str; @@ -362,7 +362,7 @@ typedef union YYSTYPE UnaryOperator unary_operator; -/* Line 350 of yacc.c */ +/* Line 374 of yacc.c */ #line 367 "scannerparser.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 @@ -386,11 +386,11 @@ int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ -#endif /* !YY_SCANNERPARSER_H */ +#endif /* !YY_YY_SCANNERPARSER_H_INCLUDED */ /* Copy the second part of user declarations. */ -/* Line 353 of yacc.c */ +/* Line 377 of yacc.c */ #line 395 "scannerparser.c" #ifdef short @@ -444,24 +444,24 @@ typedef short int yytype_int16; # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint -# define YYID(n) (n) +# define YYID(N) (N) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) @@ -1300,10 +1300,10 @@ static const yytype_int16 yytable[] = 20, 0, 0, 22, 23, 24, 25 }; -#define yypact_value_is_default(yystate) \ - ((yystate) == (-228)) +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-228))) -#define yytable_value_is_error(yytable_value) \ +#define yytable_value_is_error(Yytable_value) \ YYID (0) static const yytype_int16 yycheck[] = @@ -2143,6 +2143,15 @@ yydestruct (yymsg, yytype, yyvaluep, scanner) /* The lookahead symbol. */ int yychar; + +#ifndef YYLVAL_INITIALIZE +# define YYLVAL_INITIALIZE() +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif + /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; @@ -2202,7 +2211,7 @@ yyparse (scanner) int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -2220,7 +2229,6 @@ yyparse (scanner) Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; yyss = yyssa; yyvs = yyvsa; yystacksize = YYINITDEPTH; @@ -2238,6 +2246,8 @@ yyparse (scanner) The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; + + YYLVAL_INITIALIZE (); goto yysetstate; /*------------------------------------------------------------. @@ -2378,7 +2388,9 @@ yybackup: yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -2415,7 +2427,7 @@ yyreduce: switch (yyn) { case 2: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 225 "giscanner/scannerparser.y" { (yyval.symbol) = g_hash_table_lookup (const_table, (yyvsp[(1) - (1)].str)); @@ -2428,7 +2440,7 @@ yyreduce: break; case 3: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 234 "giscanner/scannerparser.y" { char *rest; @@ -2448,7 +2460,7 @@ yyreduce: break; case 4: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 250 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2458,7 +2470,7 @@ yyreduce: break; case 5: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 256 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2469,7 +2481,7 @@ yyreduce: break; case 7: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 264 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(2) - (3)].symbol); @@ -2477,7 +2489,7 @@ yyreduce: break; case 8: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 268 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2485,7 +2497,7 @@ yyreduce: break; case 9: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 276 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2504,7 +2516,7 @@ yyreduce: break; case 10: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 291 "giscanner/scannerparser.y" { char *strings, *string2; @@ -2519,7 +2531,7 @@ yyreduce: break; case 11: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 305 "giscanner/scannerparser.y" { (yyval.str) = g_strdup (yytext); @@ -2527,7 +2539,7 @@ yyreduce: break; case 15: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 318 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2535,7 +2547,7 @@ yyreduce: break; case 16: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 322 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2543,7 +2555,7 @@ yyreduce: break; case 17: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 326 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2551,7 +2563,7 @@ yyreduce: break; case 18: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 330 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2559,7 +2571,7 @@ yyreduce: break; case 19: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 334 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2567,7 +2579,7 @@ yyreduce: break; case 20: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 338 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2575,7 +2587,7 @@ yyreduce: break; case 21: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 342 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2583,7 +2595,7 @@ yyreduce: break; case 25: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 355 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2591,7 +2603,7 @@ yyreduce: break; case 26: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 359 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2599,7 +2611,7 @@ yyreduce: break; case 27: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 363 "giscanner/scannerparser.y" { switch ((yyvsp[(1) - (2)].unary_operator)) { @@ -2626,7 +2638,7 @@ yyreduce: break; case 28: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 386 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(3) - (4)].symbol); @@ -2637,7 +2649,7 @@ yyreduce: break; case 29: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 393 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(3) - (4)].symbol); @@ -2648,7 +2660,7 @@ yyreduce: break; case 30: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 400 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2656,7 +2668,7 @@ yyreduce: break; case 31: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 404 "giscanner/scannerparser.y" { ctype_free ((yyvsp[(3) - (4)].ctype)); @@ -2665,7 +2677,7 @@ yyreduce: break; case 32: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 412 "giscanner/scannerparser.y" { (yyval.unary_operator) = UNARY_ADDRESS_OF; @@ -2673,7 +2685,7 @@ yyreduce: break; case 33: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 416 "giscanner/scannerparser.y" { (yyval.unary_operator) = UNARY_POINTER_INDIRECTION; @@ -2681,7 +2693,7 @@ yyreduce: break; case 34: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 420 "giscanner/scannerparser.y" { (yyval.unary_operator) = UNARY_PLUS; @@ -2689,7 +2701,7 @@ yyreduce: break; case 35: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 424 "giscanner/scannerparser.y" { (yyval.unary_operator) = UNARY_MINUS; @@ -2697,7 +2709,7 @@ yyreduce: break; case 36: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 428 "giscanner/scannerparser.y" { (yyval.unary_operator) = UNARY_BITWISE_COMPLEMENT; @@ -2705,7 +2717,7 @@ yyreduce: break; case 37: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 432 "giscanner/scannerparser.y" { (yyval.unary_operator) = UNARY_LOGICAL_NEGATION; @@ -2713,7 +2725,7 @@ yyreduce: break; case 39: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 440 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(4) - (4)].symbol); @@ -2726,7 +2738,7 @@ yyreduce: break; case 41: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 453 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2736,7 +2748,7 @@ yyreduce: break; case 42: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 459 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2748,7 +2760,7 @@ yyreduce: break; case 43: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 467 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2760,7 +2772,7 @@ yyreduce: break; case 45: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 479 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2770,7 +2782,7 @@ yyreduce: break; case 46: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 485 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2780,7 +2792,7 @@ yyreduce: break; case 48: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 495 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2796,7 +2808,7 @@ yyreduce: break; case 49: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 507 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2806,7 +2818,7 @@ yyreduce: break; case 51: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 517 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2816,7 +2828,7 @@ yyreduce: break; case 52: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 523 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2826,7 +2838,7 @@ yyreduce: break; case 53: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 529 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2836,7 +2848,7 @@ yyreduce: break; case 54: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 535 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2846,7 +2858,7 @@ yyreduce: break; case 56: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 545 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2856,7 +2868,7 @@ yyreduce: break; case 57: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 551 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2866,7 +2878,7 @@ yyreduce: break; case 59: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 561 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2876,7 +2888,7 @@ yyreduce: break; case 61: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 571 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2886,7 +2898,7 @@ yyreduce: break; case 63: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 581 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2896,7 +2908,7 @@ yyreduce: break; case 65: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 591 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2908,7 +2920,7 @@ yyreduce: break; case 67: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 603 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_CONST, scanner->current_filename, lineno); @@ -2920,7 +2932,7 @@ yyreduce: break; case 69: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 615 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_get_const_boolean ((yyvsp[(1) - (5)].symbol)) ? (yyvsp[(3) - (5)].symbol) : (yyvsp[(5) - (5)].symbol); @@ -2928,7 +2940,7 @@ yyreduce: break; case 71: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 623 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2936,7 +2948,7 @@ yyreduce: break; case 85: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 646 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -2944,7 +2956,7 @@ yyreduce: break; case 87: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 659 "giscanner/scannerparser.y" { GList *l; @@ -2966,7 +2978,7 @@ yyreduce: break; case 88: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 677 "giscanner/scannerparser.y" { ctype_free ((yyvsp[(1) - (2)].ctype)); @@ -2974,7 +2986,7 @@ yyreduce: break; case 89: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 684 "giscanner/scannerparser.y" { (yyval.ctype) = (yyvsp[(2) - (2)].ctype); @@ -2983,7 +2995,7 @@ yyreduce: break; case 90: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 689 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_type_new (CTYPE_INVALID); @@ -2992,7 +3004,7 @@ yyreduce: break; case 91: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 694 "giscanner/scannerparser.y" { (yyval.ctype) = (yyvsp[(1) - (2)].ctype); @@ -3009,7 +3021,7 @@ yyreduce: break; case 93: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 708 "giscanner/scannerparser.y" { (yyval.ctype) = (yyvsp[(2) - (2)].ctype); @@ -3018,7 +3030,7 @@ yyreduce: break; case 94: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 713 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_type_new (CTYPE_INVALID); @@ -3027,7 +3039,7 @@ yyreduce: break; case 95: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 718 "giscanner/scannerparser.y" { (yyval.ctype) = (yyvsp[(2) - (2)].ctype); @@ -3036,7 +3048,7 @@ yyreduce: break; case 96: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 723 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_type_new (CTYPE_INVALID); @@ -3045,7 +3057,7 @@ yyreduce: break; case 97: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 731 "giscanner/scannerparser.y" { (yyval.list) = g_list_append (NULL, (yyvsp[(1) - (1)].symbol)); @@ -3053,7 +3065,7 @@ yyreduce: break; case 98: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 735 "giscanner/scannerparser.y" { (yyval.list) = g_list_append ((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].symbol)); @@ -3061,7 +3073,7 @@ yyreduce: break; case 101: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 747 "giscanner/scannerparser.y" { (yyval.storage_class_specifier) = STORAGE_CLASS_TYPEDEF; @@ -3069,7 +3081,7 @@ yyreduce: break; case 102: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 751 "giscanner/scannerparser.y" { (yyval.storage_class_specifier) = STORAGE_CLASS_EXTERN; @@ -3077,7 +3089,7 @@ yyreduce: break; case 103: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 755 "giscanner/scannerparser.y" { (yyval.storage_class_specifier) = STORAGE_CLASS_STATIC; @@ -3085,7 +3097,7 @@ yyreduce: break; case 104: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 759 "giscanner/scannerparser.y" { (yyval.storage_class_specifier) = STORAGE_CLASS_AUTO; @@ -3093,7 +3105,7 @@ yyreduce: break; case 105: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 763 "giscanner/scannerparser.y" { (yyval.storage_class_specifier) = STORAGE_CLASS_REGISTER; @@ -3101,7 +3113,7 @@ yyreduce: break; case 106: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 770 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_type_new (CTYPE_VOID); @@ -3109,7 +3121,7 @@ yyreduce: break; case 107: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 774 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_basic_type_new ("char"); @@ -3117,7 +3129,7 @@ yyreduce: break; case 108: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 778 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_basic_type_new ("short"); @@ -3125,7 +3137,7 @@ yyreduce: break; case 109: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 782 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_basic_type_new ("int"); @@ -3133,7 +3145,7 @@ yyreduce: break; case 110: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 786 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_basic_type_new ("long"); @@ -3141,7 +3153,7 @@ yyreduce: break; case 111: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 790 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_basic_type_new ("float"); @@ -3149,7 +3161,7 @@ yyreduce: break; case 112: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 794 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_basic_type_new ("double"); @@ -3157,7 +3169,7 @@ yyreduce: break; case 113: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 798 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_basic_type_new ("signed"); @@ -3165,7 +3177,7 @@ yyreduce: break; case 114: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 802 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_basic_type_new ("unsigned"); @@ -3173,7 +3185,7 @@ yyreduce: break; case 115: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 806 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_basic_type_new ("bool"); @@ -3181,7 +3193,7 @@ yyreduce: break; case 118: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 812 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_typedef_new ((yyvsp[(1) - (1)].str)); @@ -3190,7 +3202,7 @@ yyreduce: break; case 119: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 820 "giscanner/scannerparser.y" { GISourceSymbol *sym; @@ -3214,7 +3226,7 @@ yyreduce: break; case 120: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 840 "giscanner/scannerparser.y" { (yyval.ctype) = (yyvsp[(1) - (4)].ctype); @@ -3223,7 +3235,7 @@ yyreduce: break; case 121: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 845 "giscanner/scannerparser.y" { (yyval.ctype) = (yyvsp[(1) - (2)].ctype); @@ -3232,7 +3244,7 @@ yyreduce: break; case 122: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 853 "giscanner/scannerparser.y" { scanner->private = FALSE; @@ -3241,7 +3253,7 @@ yyreduce: break; case 123: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 858 "giscanner/scannerparser.y" { scanner->private = FALSE; @@ -3250,7 +3262,7 @@ yyreduce: break; case 125: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 867 "giscanner/scannerparser.y" { (yyval.list) = g_list_concat ((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].list)); @@ -3258,7 +3270,7 @@ yyreduce: break; case 126: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 874 "giscanner/scannerparser.y" { GList *l; @@ -3279,7 +3291,7 @@ yyreduce: break; case 127: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 894 "giscanner/scannerparser.y" { (yyval.ctype) = (yyvsp[(1) - (2)].ctype); @@ -3288,7 +3300,7 @@ yyreduce: break; case 129: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 900 "giscanner/scannerparser.y" { (yyval.ctype) = (yyvsp[(2) - (2)].ctype); @@ -3297,7 +3309,7 @@ yyreduce: break; case 130: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 905 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_type_new (CTYPE_INVALID); @@ -3306,7 +3318,7 @@ yyreduce: break; case 131: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 913 "giscanner/scannerparser.y" { (yyval.list) = g_list_append (NULL, (yyvsp[(1) - (1)].symbol)); @@ -3314,7 +3326,7 @@ yyreduce: break; case 132: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 917 "giscanner/scannerparser.y" { (yyval.list) = g_list_append ((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].symbol)); @@ -3322,7 +3334,7 @@ yyreduce: break; case 133: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 924 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -3330,7 +3342,7 @@ yyreduce: break; case 135: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 929 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -3338,7 +3350,7 @@ yyreduce: break; case 136: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 933 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(1) - (3)].symbol); @@ -3350,7 +3362,7 @@ yyreduce: break; case 137: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 944 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_enum_new ((yyvsp[(2) - (5)].str)); @@ -3361,7 +3373,7 @@ yyreduce: break; case 138: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 951 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_enum_new (NULL); @@ -3372,7 +3384,7 @@ yyreduce: break; case 139: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 958 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_enum_new ((yyvsp[(2) - (6)].str)); @@ -3383,7 +3395,7 @@ yyreduce: break; case 140: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 965 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_enum_new (NULL); @@ -3394,7 +3406,7 @@ yyreduce: break; case 141: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 972 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_enum_new ((yyvsp[(2) - (2)].str)); @@ -3402,7 +3414,7 @@ yyreduce: break; case 142: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 979 "giscanner/scannerparser.y" { scanner->flags = FALSE; @@ -3411,7 +3423,7 @@ yyreduce: break; case 143: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 987 "giscanner/scannerparser.y" { /* reset flag before the first enum value */ @@ -3420,7 +3432,7 @@ yyreduce: break; case 144: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 992 "giscanner/scannerparser.y" { (yyvsp[(2) - (2)].symbol)->private = scanner->private; @@ -3429,7 +3441,7 @@ yyreduce: break; case 145: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 997 "giscanner/scannerparser.y" { (yyvsp[(3) - (3)].symbol)->private = scanner->private; @@ -3438,7 +3450,7 @@ yyreduce: break; case 146: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1005 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_OBJECT, scanner->current_filename, lineno); @@ -3450,7 +3462,7 @@ yyreduce: break; case 147: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1013 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_OBJECT, scanner->current_filename, lineno); @@ -3463,7 +3475,7 @@ yyreduce: break; case 148: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1025 "giscanner/scannerparser.y" { (yyval.type_qualifier) = TYPE_QUALIFIER_CONST; @@ -3471,7 +3483,7 @@ yyreduce: break; case 149: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1029 "giscanner/scannerparser.y" { (yyval.type_qualifier) = TYPE_QUALIFIER_RESTRICT; @@ -3479,7 +3491,7 @@ yyreduce: break; case 150: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1033 "giscanner/scannerparser.y" { (yyval.type_qualifier) = TYPE_QUALIFIER_EXTENSION; @@ -3487,7 +3499,7 @@ yyreduce: break; case 151: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1037 "giscanner/scannerparser.y" { (yyval.type_qualifier) = TYPE_QUALIFIER_VOLATILE; @@ -3495,7 +3507,7 @@ yyreduce: break; case 152: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1044 "giscanner/scannerparser.y" { (yyval.function_specifier) = FUNCTION_INLINE; @@ -3503,7 +3515,7 @@ yyreduce: break; case 153: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1051 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(2) - (2)].symbol); @@ -3512,7 +3524,7 @@ yyreduce: break; case 155: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1060 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -3521,7 +3533,7 @@ yyreduce: break; case 156: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1065 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(2) - (3)].symbol); @@ -3529,7 +3541,7 @@ yyreduce: break; case 157: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1069 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(1) - (4)].symbol); @@ -3538,7 +3550,7 @@ yyreduce: break; case 158: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1074 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(1) - (3)].symbol); @@ -3547,7 +3559,7 @@ yyreduce: break; case 159: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1079 "giscanner/scannerparser.y" { GISourceType *func = gi_source_function_new (); @@ -3561,7 +3573,7 @@ yyreduce: break; case 160: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1089 "giscanner/scannerparser.y" { GISourceType *func = gi_source_function_new (); @@ -3572,7 +3584,7 @@ yyreduce: break; case 161: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1096 "giscanner/scannerparser.y" { GISourceType *func = gi_source_function_new (); @@ -3582,7 +3594,7 @@ yyreduce: break; case 162: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1105 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_pointer_new (NULL); @@ -3591,7 +3603,7 @@ yyreduce: break; case 163: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1110 "giscanner/scannerparser.y" { (yyval.ctype) = gi_source_pointer_new (NULL); @@ -3599,7 +3611,7 @@ yyreduce: break; case 164: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1114 "giscanner/scannerparser.y" { GISourceType **base = &((yyvsp[(3) - (3)].ctype)->base_type); @@ -3614,7 +3626,7 @@ yyreduce: break; case 165: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1125 "giscanner/scannerparser.y" { GISourceType **base = &((yyvsp[(2) - (2)].ctype)->base_type); @@ -3628,7 +3640,7 @@ yyreduce: break; case 167: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1139 "giscanner/scannerparser.y" { (yyval.type_qualifier) = (yyvsp[(1) - (2)].type_qualifier) | (yyvsp[(2) - (2)].type_qualifier); @@ -3636,7 +3648,7 @@ yyreduce: break; case 168: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1146 "giscanner/scannerparser.y" { (yyval.list) = g_list_append (NULL, (yyvsp[(1) - (1)].symbol)); @@ -3644,7 +3656,7 @@ yyreduce: break; case 169: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1150 "giscanner/scannerparser.y" { (yyval.list) = g_list_append ((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].symbol)); @@ -3652,7 +3664,7 @@ yyreduce: break; case 170: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1157 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(2) - (2)].symbol); @@ -3661,7 +3673,7 @@ yyreduce: break; case 171: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1162 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(2) - (2)].symbol); @@ -3670,7 +3682,7 @@ yyreduce: break; case 172: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1167 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -3679,7 +3691,7 @@ yyreduce: break; case 173: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1172 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_ELLIPSIS, scanner->current_filename, lineno); @@ -3687,7 +3699,7 @@ yyreduce: break; case 174: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1179 "giscanner/scannerparser.y" { GISourceSymbol *sym = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -3697,7 +3709,7 @@ yyreduce: break; case 175: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1185 "giscanner/scannerparser.y" { GISourceSymbol *sym = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -3707,7 +3719,7 @@ yyreduce: break; case 178: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1199 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -3716,7 +3728,7 @@ yyreduce: break; case 180: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1205 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(2) - (2)].symbol); @@ -3725,7 +3737,7 @@ yyreduce: break; case 181: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1213 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(2) - (3)].symbol); @@ -3733,7 +3745,7 @@ yyreduce: break; case 182: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1217 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -3742,7 +3754,7 @@ yyreduce: break; case 183: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1222 "giscanner/scannerparser.y" { (yyval.symbol) = gi_source_symbol_new (CSYMBOL_TYPE_INVALID, scanner->current_filename, lineno); @@ -3751,7 +3763,7 @@ yyreduce: break; case 184: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1227 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(1) - (3)].symbol); @@ -3760,7 +3772,7 @@ yyreduce: break; case 185: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1232 "giscanner/scannerparser.y" { (yyval.symbol) = (yyvsp[(1) - (4)].symbol); @@ -3769,7 +3781,7 @@ yyreduce: break; case 186: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1237 "giscanner/scannerparser.y" { GISourceType *func = gi_source_function_new (); @@ -3779,7 +3791,7 @@ yyreduce: break; case 187: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1243 "giscanner/scannerparser.y" { GISourceType *func = gi_source_function_new (); @@ -3793,7 +3805,7 @@ yyreduce: break; case 188: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1253 "giscanner/scannerparser.y" { GISourceType *func = gi_source_function_new (); @@ -3803,7 +3815,7 @@ yyreduce: break; case 189: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1259 "giscanner/scannerparser.y" { GISourceType *func = gi_source_function_new (); @@ -3817,7 +3829,7 @@ yyreduce: break; case 190: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1272 "giscanner/scannerparser.y" { (yyval.str) = g_strdup (yytext); @@ -3825,7 +3837,7 @@ yyreduce: break; case 240: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1379 "giscanner/scannerparser.y" { (yyval.str) = g_strdup (yytext + strlen ("#define ")); @@ -3833,7 +3845,7 @@ yyreduce: break; case 241: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1386 "giscanner/scannerparser.y" { (yyval.str) = g_strdup (yytext + strlen ("#define ")); @@ -3841,7 +3853,7 @@ yyreduce: break; case 243: -/* Line 1787 of yacc.c */ +/* Line 1813 of yacc.c */ #line 1397 "giscanner/scannerparser.y" { if ((yyvsp[(2) - (2)].symbol)->const_int_set || (yyvsp[(2) - (2)].symbol)->const_double_set || (yyvsp[(2) - (2)].symbol)->const_string != NULL) { @@ -3853,8 +3865,8 @@ yyreduce: break; -/* Line 1787 of yacc.c */ -#line 3858 "scannerparser.c" +/* Line 1813 of yacc.c */ +#line 3870 "scannerparser.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -4017,7 +4029,9 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -4083,7 +4097,7 @@ yyreturn: } -/* Line 2048 of yacc.c */ +/* Line 2076 of yacc.c */ #line 1412 "giscanner/scannerparser.y" static void @@ -4308,4 +4322,3 @@ gi_source_scanner_lex_filename (GISourceScanner *scanner, const gchar *filename) return TRUE; } - diff --git a/scannerparser.h b/scannerparser.h index 9b7129e..a3b9f8f 100644 --- a/scannerparser.h +++ b/scannerparser.h @@ -1,4 +1,4 @@ -/* A Bison parser, made by GNU Bison 2.6.1. */ +/* A Bison parser, made by GNU Bison 2.6.4. */ /* Bison interface for Yacc-like parsers in C @@ -30,8 +30,8 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -#ifndef YY_SCANNERPARSER_H -# define YY_SCANNERPARSER_H +#ifndef YY_YY_SCANNERPARSER_H_INCLUDED +# define YY_YY_SCANNERPARSER_H_INCLUDED /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 1 @@ -191,7 +191,7 @@ extern int yydebug; #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { -/* Line 2049 of yacc.c */ +/* Line 2077 of yacc.c */ #line 134 "giscanner/scannerparser.y" char *str; @@ -204,7 +204,7 @@ typedef union YYSTYPE UnaryOperator unary_operator; -/* Line 2049 of yacc.c */ +/* Line 2077 of yacc.c */ #line 209 "scannerparser.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 @@ -228,4 +228,4 @@ int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ -#endif /* !YY_SCANNERPARSER_H */ +#endif /* !YY_YY_SCANNERPARSER_H_INCLUDED */ diff --git a/tests/Makefile.am b/tests/Makefile.am index b4985b9..56fc479 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -28,7 +28,9 @@ BUILT_SOURCES += everything.c everything.h CLEANFILES += \ $(BUILT_SOURCES) \ everything-stamp.h \ + Everything-1.0.gir \ Everything-1.0.typelib \ + GIMarshallingTests-1.0.gir \ GIMarshallingTests-1.0.typelib everything-stamp.h: Makefile diff --git a/tests/Makefile.in b/tests/Makefile.in index ef899fb..46c0e26 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -436,8 +436,9 @@ INTROSPECTION_DOCTOOL_ARGS = \ SUBDIRS = . scanner repository offsets warn EXTRA_DIST = gimarshallingtests.h BUILT_SOURCES = everything.c everything.h -CLEANFILES = $(BUILT_SOURCES) everything-stamp.h \ - Everything-1.0.typelib GIMarshallingTests-1.0.typelib +CLEANFILES = $(BUILT_SOURCES) everything-stamp.h Everything-1.0.gir \ + Everything-1.0.typelib GIMarshallingTests-1.0.gir \ + GIMarshallingTests-1.0.typelib AM_CFLAGS = $(GOBJECT_CFLAGS) LIBADD = $(GOBJECT_LIBS) testsdir = $(datadir)/gobject-introspection-1.0/tests diff --git a/tests/gimarshallingtests.h b/tests/gimarshallingtests.h index 67c2f70..33f3b3e 100644 --- a/tests/gimarshallingtests.h +++ b/tests/gimarshallingtests.h @@ -807,7 +807,7 @@ struct _GIMarshallingTestsObjectClass /** * GIMarshallingTestsObjectClass::vfunc_return_enum: */ - GIMarshallingTestsFlags (* vfunc_return_enum) (GIMarshallingTestsObject *self); + GIMarshallingTestsEnum (* vfunc_return_enum) (GIMarshallingTestsObject *self); /** * GIMarshallingTestsObjectClass::vfunc_out_enum: @@ -910,7 +910,6 @@ void gi_marshalling_tests_object_full_out (GIMarshallingTestsObject **object); void gi_marshalling_tests_object_none_inout (GIMarshallingTestsObject **object); void gi_marshalling_tests_object_full_inout (GIMarshallingTestsObject **object); -void gi_marshalling_tests_object_inout_same (GIMarshallingTestsObject **object); void gi_marshalling_tests_object_int8_in (GIMarshallingTestsObject *object, gint8 in); void gi_marshalling_tests_object_int8_out (GIMarshallingTestsObject *object, gint8 *out); diff --git a/tests/scanner/GetType-1.0-expected.gir b/tests/scanner/GetType-1.0-expected.gir index 7d5c1bc..ae17525 100644 --- a/tests/scanner/GetType-1.0-expected.gir +++ b/tests/scanner/GetType-1.0-expected.gir @@ -28,33 +28,33 @@ and/or use gtk-doc annotations. --> - This shouldn't be scanned as a *_get_type function because it doesn't return + This shouldn't be scanned as a *_get_type function because it doesn't return a GType. It will generate a warning. - true + true - This shouldn't be scanned as a *_get_type function because it doesn't return + This shouldn't be scanned as a *_get_type function because it doesn't return a GType. It will generate a warning. - true + true - This shouldn't be scanned as a *_get_type function because it takes + This shouldn't be scanned as a *_get_type function because it takes arguments. - 0 + 0 - self + self diff --git a/tests/scanner/Makefile.am b/tests/scanner/Makefile.am index 31487a6..133dfaa 100644 --- a/tests/scanner/Makefile.am +++ b/tests/scanner/Makefile.am @@ -142,6 +142,7 @@ GIRS += Bar-1.0.gir endif EXTRA_DIST += headeronly.h +CLEANFILES += Headeronly-1.0.gir Headeronly-1.0.gir: headeronly.h $(AM_V_GEN) $(INTROSPECTION_SCANNER) $(INTROSPECTION_SCANNER_ARGS) --warn-all --warn-error --reparse-validate --namespace=Headeronly --nsversion=1.0 --header-only --output=$@ $< @@ -153,31 +154,33 @@ if BUILD_DOCTOOL DOCGIRS = Regress-1.0.gir CHECKDOCS = $(DOCGIRS:.gir=-C.page.check) $(DOCGIRS:.gir=-Python.page.check) $(DOCGIRS:.gir=-Gjs.page.check) MALLARD_DIRS = $(DOCGIRS:.gir=-C) $(DOCGIRS:.gir=-Python) $(DOCGIRS:.gir=-Gjs) +MALLARD_CLEAN = $(DOCGIRS:.gir=-C)/* $(DOCGIRS:.gir=-Python)/* $(DOCGIRS:.gir=-Gjs)/* EXPECTED_MALLARD_DIRS = $(MALLARD_DIRS:=-expected) +CLEANFILES += $(MALLARD_CLEAN) %-C: %.gir $(AM_V_GEN) - $(AM_V_at)rm -f $*-C/*.page - $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language C $*.gir -o $*-C/ + $(AM_V_at)-rm -rf $(builddir)/$*-C + $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language C $*.gir -o $(builddir)/$*-C/ %-Python: %.gir $(AM_V_GEN) - $(AM_V_at)rm -f $*-Python/*.page - $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language Python $*.gir -o $*-Python/ + $(AM_V_at)-rm -rf $(builddir)/$*-Python + $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language Python $*.gir -o $(builddir)/$*-Python/ %-Gjs: %.gir $(AM_V_GEN) - $(AM_V_at)rm -f $*-Gjs/*.page - $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language Gjs $*.gir -o $*-Gjs/ + $(AM_V_at)-rm -rf $(builddir)/$*-Gjs + $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language Gjs $*.gir -o $(builddir)/$*-Gjs/ %-C.page.check: %-C - @diff -u -w -B -U 10 $(srcdir)/$*-C-expected $*-C && echo " TEST $*-C" + @diff -r -u -w -B -U 10 $(srcdir)/$*-C-expected $(builddir)/$*-C && echo " TEST $*-C" %-Python.page.check: %-Python - @diff -u -w -B -U 10 $(srcdir)/$*-Python-expected $*-Python && echo " TEST $*-Python" + @diff -r -u -w -B -U 10 $(srcdir)/$*-Python-expected $(builddir)/$*-Python && echo " TEST $*-Python" %-Gjs.page.check: %-Gjs - @diff -u -w -B -U 10 $(srcdir)/$*-Gjs-expected $*-Gjs && echo " TEST $*-Gjs" + @diff -r -u -w -B -U 10 $(srcdir)/$*-Gjs-expected $(builddir)/$*-Gjs && echo " TEST $*-Gjs" else CHECKDOCS = endif diff --git a/tests/scanner/Makefile.in b/tests/scanner/Makefile.in index 21b0f72..b321a61 100644 --- a/tests/scanner/Makefile.in +++ b/tests/scanner/Makefile.in @@ -108,6 +108,7 @@ DIST_COMMON = $(top_srcdir)/common.mk \ @HAVE_CAIRO_TRUE@am__append_5 = cairo-1.0 @OS_WIN32_FALSE@check_PROGRAMS = barapp$(EXEEXT) @OS_WIN32_FALSE@am__append_6 = Bar-1.0.gir +@BUILD_DOCTOOL_TRUE@am__append_7 = $(MALLARD_CLEAN) subdir = tests/scanner ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \ @@ -557,7 +558,7 @@ TYPELIBS = $(GIRS:.gir=.typelib) CHECKGIRS = $(GIRS:.gir=.gir.check) EXPECTEDGIRS = $(GIRS:.gir=-expected.gir) INTROSPECTION_GIRS = $(GIRS) -CLEANFILES = $(TYPELIBS) $(GIRS) +CLEANFILES = $(TYPELIBS) $(GIRS) Headeronly-1.0.gir $(am__append_7) EXTRA_DIST = $(EXPECTEDGIRS) headeronly.h annotationparser/README \ annotationparser/test_parser.py \ annotationparser/test_patterns.py \ @@ -647,6 +648,7 @@ GetType_1_0_gir_SCANNERFLAGS = --c-include="gettype.h" --identifier-prefix=GetTy @BUILD_DOCTOOL_FALSE@CHECKDOCS = @BUILD_DOCTOOL_TRUE@CHECKDOCS = $(DOCGIRS:.gir=-C.page.check) $(DOCGIRS:.gir=-Python.page.check) $(DOCGIRS:.gir=-Gjs.page.check) @BUILD_DOCTOOL_TRUE@MALLARD_DIRS = $(DOCGIRS:.gir=-C) $(DOCGIRS:.gir=-Python) $(DOCGIRS:.gir=-Gjs) +@BUILD_DOCTOOL_TRUE@MALLARD_CLEAN = $(DOCGIRS:.gir=-C)/* $(DOCGIRS:.gir=-Python)/* $(DOCGIRS:.gir=-Gjs)/* @BUILD_DOCTOOL_TRUE@EXPECTED_MALLARD_DIRS = $(MALLARD_DIRS:=-expected) all: all-am @@ -1184,27 +1186,27 @@ Headeronly-1.0.gir: headeronly.h @BUILD_DOCTOOL_TRUE@%-C: %.gir @BUILD_DOCTOOL_TRUE@ $(AM_V_GEN) -@BUILD_DOCTOOL_TRUE@ $(AM_V_at)rm -f $*-C/*.page -@BUILD_DOCTOOL_TRUE@ $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language C $*.gir -o $*-C/ +@BUILD_DOCTOOL_TRUE@ $(AM_V_at)-rm -rf $(builddir)/$*-C +@BUILD_DOCTOOL_TRUE@ $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language C $*.gir -o $(builddir)/$*-C/ @BUILD_DOCTOOL_TRUE@%-Python: %.gir @BUILD_DOCTOOL_TRUE@ $(AM_V_GEN) -@BUILD_DOCTOOL_TRUE@ $(AM_V_at)rm -f $*-Python/*.page -@BUILD_DOCTOOL_TRUE@ $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language Python $*.gir -o $*-Python/ +@BUILD_DOCTOOL_TRUE@ $(AM_V_at)-rm -rf $(builddir)/$*-Python +@BUILD_DOCTOOL_TRUE@ $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language Python $*.gir -o $(builddir)/$*-Python/ @BUILD_DOCTOOL_TRUE@%-Gjs: %.gir @BUILD_DOCTOOL_TRUE@ $(AM_V_GEN) -@BUILD_DOCTOOL_TRUE@ $(AM_V_at)rm -f $*-Gjs/*.page -@BUILD_DOCTOOL_TRUE@ $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language Gjs $*.gir -o $*-Gjs/ +@BUILD_DOCTOOL_TRUE@ $(AM_V_at)-rm -rf $(builddir)/$*-Gjs +@BUILD_DOCTOOL_TRUE@ $(AM_V_at)$(INTROSPECTION_DOCTOOL) $(INTROSPECTION_DOCTOOL_ARGS) --language Gjs $*.gir -o $(builddir)/$*-Gjs/ @BUILD_DOCTOOL_TRUE@%-C.page.check: %-C -@BUILD_DOCTOOL_TRUE@ @diff -u -w -B -U 10 $(srcdir)/$*-C-expected $*-C && echo " TEST $*-C" +@BUILD_DOCTOOL_TRUE@ @diff -r -u -w -B -U 10 $(srcdir)/$*-C-expected $(builddir)/$*-C && echo " TEST $*-C" @BUILD_DOCTOOL_TRUE@%-Python.page.check: %-Python -@BUILD_DOCTOOL_TRUE@ @diff -u -w -B -U 10 $(srcdir)/$*-Python-expected $*-Python && echo " TEST $*-Python" +@BUILD_DOCTOOL_TRUE@ @diff -r -u -w -B -U 10 $(srcdir)/$*-Python-expected $(builddir)/$*-Python && echo " TEST $*-Python" @BUILD_DOCTOOL_TRUE@%-Gjs.page.check: %-Gjs -@BUILD_DOCTOOL_TRUE@ @diff -u -w -B -U 10 $(srcdir)/$*-Gjs-expected $*-Gjs && echo " TEST $*-Gjs" +@BUILD_DOCTOOL_TRUE@ @diff -r -u -w -B -U 10 $(srcdir)/$*-Gjs-expected $(builddir)/$*-Gjs && echo " TEST $*-Gjs" check-local: Headeronly-1.0.gir $(CHECKGIRS) $(CHECKDOCS) $(TYPELIBS) diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject-tab-property.page b/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject-tab-property.page index 2366f20..446729b 100644 --- a/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject-tab-property.page +++ b/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject-tab-property.page @@ -15,7 +15,7 @@ -

This is a property regress_annotation intentionally indented with a mix +

This is a property annotation intentionally indented with a mix of tabs and strings to test the tab handling capabilities of the scanner.

diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject.page b/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject.page index 80e2546..80d4339 100644 --- a/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject.page +++ b/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject.page @@ -14,7 +14,7 @@ -

This is an object used to test regress_annotations.

+

This is an object used to test annotations.

diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject.watch_full.page b/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject.watch_full.page index 5de06c0..1fe2080 100644 --- a/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject.watch_full.page +++ b/tests/scanner/Regress-1.0-C-expected/Regress.AnnotationObject.watch_full.page @@ -42,7 +42,7 @@ void regress_annotation_object_watch_full (RegressAnnotationObject* object, -

Test overriding via the "Rename To" regress_annotation.

+

Test overriding via the "Rename To" annotation.

diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.LikeXklConfigItem.page b/tests/scanner/Regress-1.0-C-expected/Regress.LikeXklConfigItem.page new file mode 100644 index 0000000..3b14aae --- /dev/null +++ b/tests/scanner/Regress-1.0-C-expected/Regress.LikeXklConfigItem.page @@ -0,0 +1,25 @@ + + + + + + + + Regress.LikeXklConfigItem + + + + + + + + + + + + diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.LikeXklConfigItem.set_name.page b/tests/scanner/Regress-1.0-C-expected/Regress.LikeXklConfigItem.set_name.page new file mode 100644 index 0000000..0a4aecb --- /dev/null +++ b/tests/scanner/Regress-1.0-C-expected/Regress.LikeXklConfigItem.set_name.page @@ -0,0 +1,57 @@ + + + + + + + + void + + regress_like_xkl_config_item_set_name + + RegressLikeXklConfigItem* + self + + + const char* + name + + + + + regress_like_xkl_config_item_set_name + + +void regress_like_xkl_config_item_set_name (RegressLikeXklConfigItem* self, + const char* name); + + + + + + + + + + +<code>self</code> + + + +<code>name</code> + + + +<code>Returns</code> + + + + + + + diff --git a/tests/scanner/Regress-1.0-C-expected/Regress.annotation_custom_destroy.page b/tests/scanner/Regress-1.0-C-expected/Regress.annotation_custom_destroy.page index 8e08a23..2a474a5 100644 --- a/tests/scanner/Regress-1.0-C-expected/Regress.annotation_custom_destroy.page +++ b/tests/scanner/Regress-1.0-C-expected/Regress.annotation_custom_destroy.page @@ -38,7 +38,7 @@ void regress_annotation_custom_destroy (RegressAnnotationCallback callback,

Test messing up the heuristic of closure/destroy-notification -detection, and fixing it via regress_annotations.

+detection, and fixing it via annotations.

diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject-tab-property.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject-tab-property.page index 9c79727..c2444fa 100644 --- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject-tab-property.page +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject-tab-property.page @@ -18,7 +18,7 @@ -

This is a property regress_annotation intentionally indented with a mix +

This is a property annotation intentionally indented with a mix of tabs and strings to test the tab handling capabilities of the scanner.

diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.page index 95675a6..f4f0130 100644 --- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.page +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.page @@ -23,7 +23,7 @@ let annotation_object = new Regress.AnnotationObject({ -

This is an object used to test regress_annotations.

+

This is an object used to test annotations.

diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.watch_full.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.watch_full.page index a5ccad4..99bfaf1 100644 --- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.watch_full.page +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.AnnotationObject.watch_full.page @@ -29,7 +29,7 @@ function watch_full(func:Regress.AnnotationForeachFunc):void { -

Test overriding via the "Rename To" regress_annotation.

+

Test overriding via the "Rename To" annotation.

diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.LikeXklConfigItem.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.LikeXklConfigItem.page new file mode 100644 index 0000000..fb4831f --- /dev/null +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.LikeXklConfigItem.page @@ -0,0 +1,25 @@ + + + + + + + + Regress.LikeXklConfigItem + + + + + + + + + + + + diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.LikeXklConfigItem.set_name.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.LikeXklConfigItem.set_name.page new file mode 100644 index 0000000..f81bc5d --- /dev/null +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.LikeXklConfigItem.set_name.page @@ -0,0 +1,46 @@ + + + + + + + + void + + regress_like_xkl_config_item_set_name + + String + name + + + + + Regress.LikeXklConfigItem.prototype.set_name + + +function set_name(name:String):void { + // Gjs wrapper for regress_like_xkl_config_item_set_name() +} + + + + + + + + + + +<code>name</code> + + + + + + + diff --git a/tests/scanner/Regress-1.0-Gjs-expected/Regress.annotation_custom_destroy.page b/tests/scanner/Regress-1.0-Gjs-expected/Regress.annotation_custom_destroy.page index 4cc018c..c3e9653 100644 --- a/tests/scanner/Regress-1.0-Gjs-expected/Regress.annotation_custom_destroy.page +++ b/tests/scanner/Regress-1.0-Gjs-expected/Regress.annotation_custom_destroy.page @@ -30,7 +30,7 @@ function annotation_custom_destroy(callback:Regress.AnnotationCallback):void {

Test messing up the heuristic of closure/destroy-notification -detection, and fixing it via regress_annotations.

+detection, and fixing it via annotations.

diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject-tab-property.page b/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject-tab-property.page index ed219fe..c417d1e 100644 --- a/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject-tab-property.page +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject-tab-property.page @@ -18,7 +18,7 @@ -

This is a property regress_annotation intentionally indented with a mix +

This is a property annotation intentionally indented with a mix of tabs and strings to test the tab handling capabilities of the scanner.

diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject.page b/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject.page index ec6a11f..006766f 100644 --- a/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject.page +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject.page @@ -18,7 +18,7 @@ from gi.repository import Regress annotation_object = Regress.AnnotationObject(function_property=value, string_property=value, tab_property=value) -

This is an object used to test regress_annotations.

+

This is an object used to test annotations.

diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject.watch_full.page b/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject.watch_full.page index 28ca71a..66a53d5 100644 --- a/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject.watch_full.page +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.AnnotationObject.watch_full.page @@ -42,7 +42,7 @@ def watch_full(self, func, user_data, destroy): -

Test overriding via the "Rename To" regress_annotation.

+

Test overriding via the "Rename To" annotation.

diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.LikeXklConfigItem.page b/tests/scanner/Regress-1.0-Python-expected/Regress.LikeXklConfigItem.page new file mode 100644 index 0000000..fb4831f --- /dev/null +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.LikeXklConfigItem.page @@ -0,0 +1,25 @@ + + + + + + + + Regress.LikeXklConfigItem + + + + + + + + + + + + diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.LikeXklConfigItem.set_name.page b/tests/scanner/Regress-1.0-Python-expected/Regress.LikeXklConfigItem.set_name.page new file mode 100644 index 0000000..a6815c8 --- /dev/null +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.LikeXklConfigItem.set_name.page @@ -0,0 +1,55 @@ + + + + + + + + none + + regress_like_xkl_config_item_set_name + + Regress.LikeXklConfigItem + self + + + unicode + name + + + + + Regress.LikeXklConfigItem.set_name + + +@accepts(Regress.LikeXklConfigItem, unicode) +@returns(none) +def set_name(self, name): + # Python wrapper for regress_like_xkl_config_item_set_name() + + + + + + + + + + +<code>self</code> + + + +<code>name</code> + + + + + + + diff --git a/tests/scanner/Regress-1.0-Python-expected/Regress.annotation_custom_destroy.page b/tests/scanner/Regress-1.0-Python-expected/Regress.annotation_custom_destroy.page index 7afb97c..860107f 100644 --- a/tests/scanner/Regress-1.0-Python-expected/Regress.annotation_custom_destroy.page +++ b/tests/scanner/Regress-1.0-Python-expected/Regress.annotation_custom_destroy.page @@ -39,7 +39,7 @@ def annotation_custom_destroy(callback, destroy, data):

Test messing up the heuristic of closure/destroy-notification -detection, and fixing it via regress_annotations.

+detection, and fixing it via annotations.

diff --git a/tests/scanner/Regress-1.0-expected.gir b/tests/scanner/Regress-1.0-expected.gir index 53773ca..0dadc59 100644 --- a/tests/scanner/Regress-1.0-expected.gir +++ b/tests/scanner/Regress-1.0-expected.gir @@ -16,7 +16,7 @@ and/or use gtk-doc annotations. --> c:identifier-prefixes="Regress" c:symbol-prefixes="regress"> - Typedef TestBoxed to test caller-allocates correctness + Typedef TestBoxed to test caller-allocates correctness @@ -26,18 +26,18 @@ and/or use gtk-doc annotations. --> - Compatibility typedef, like telepathy-glib's TpIntSet + Compatibility typedef, like telepathy-glib's TpIntSet - Typedef'd GPtrArray for some reason + Typedef'd GPtrArray for some reason - Typedef'd va_list for additional reasons + Typedef'd va_list for additional reasons value="10000000000UL" c:type="REGRESS_ANNOTATION_CALCULATED_LARGE" version="1.4"> - Constant to define a calculated large value + Constant to define a calculated large value - Constant to define a calculated large value + Constant to define a calculated large value - This is a callback. + This is a callback. - array of ints + array of ints - array of ints + array of ints @@ -106,16 +106,16 @@ and/or use gtk-doc annotations. --> - This is a callback taking a list. + This is a callback taking a list. - list of strings + list of strings - list of strings + list of strings @@ -123,14 +123,14 @@ and/or use gtk-doc annotations. --> - This is a callback with a 'closure' argument that is not named + This is a callback with a 'closure' argument that is not named 'user_data' and hence has to be annotated. - The user data + The user data @@ -143,16 +143,16 @@ and/or use gtk-doc annotations. --> glib:get-type="regress_annotation_object_get_type" glib:type-struct="AnnotationObjectClass"> - This is an object used to test regress_annotations. + This is an object used to test annotations. - %NULL always + %NULL always - a #GObject + a #GObject @@ -162,66 +162,66 @@ and/or use gtk-doc annotations. --> - This is a test for out arguments; GObject defaults to transfer + This is a test for out arguments; GObject defaults to transfer - an int + an int - a #GObject + a #GObject - a #GObject + a #GObject - This is a test for out arguments, one transferred, other not + This is a test for out arguments, one transferred, other not - an int + an int - a #GObject + a #GObject - a #GObject + a #GObject - a #GObject + a #GObject - Test taking a zero-terminated array + Test taking a zero-terminated array - a #GObject + a #GObject - Sequence of numbers + Sequence of numbers @@ -230,60 +230,60 @@ and/or use gtk-doc annotations. --> - Test taking an array with length parameter + Test taking an array with length parameter - a #GObject + a #GObject - Sequence of numbers that are zero-terminated + Sequence of numbers that are zero-terminated - Length of number array + Length of number array - Test taking a zero-terminated array with length parameter + Test taking a zero-terminated array with length parameter - a #RegressAnnotationObject + a #RegressAnnotationObject - Sequence of numbers that are zero-terminated + Sequence of numbers that are zero-terminated - Length of number array + Length of number array - Test returning a caller-owned object + Test returning a caller-owned object - The object + The object - a #GObject + a #GObject @@ -293,12 +293,12 @@ and/or use gtk-doc annotations. --> deprecated="Use regress_annotation_object_create_object() instead." deprecated-version="0.12"> - %NULL always + %NULL always - a #GObject + a #GObject @@ -316,35 +316,35 @@ and/or use gtk-doc annotations. --> - Test taking a call-scoped callback + Test taking a call-scoped callback - a #RegressAnnotationObject + a #RegressAnnotationObject - Callback to invoke + Callback to invoke - Callback user data + Callback user data - This is a test for returning a hash table mapping strings to + This is a test for returning a hash table mapping strings to objects. - hash table + hash table @@ -352,42 +352,42 @@ objects. - a #GObject + a #GObject - This is a test for returning a list of objects. + This is a test for returning a list of objects. The list itself should be freed, but not the internal objects, intentionally similar example to gtk_container_get_children - list of objects + list of objects - a #GObject + a #GObject - This is a test for returning a list of strings, where + This is a test for returning a list of strings, where each string needs to be freed. - list of strings + list of strings - a #GObject + a #GObject @@ -399,77 +399,77 @@ each string needs to be freed. - A #RegressAnnotationObject + A #RegressAnnotationObject - This is a test for in arguments + This is a test for in arguments - an int + an int - a #GObject + a #GObject - This is an argument test + This is an argument test - This is a test for out arguments + This is a test for out arguments - an int + an int - a #GObject + a #GObject - This is an argument test + This is an argument test - This is a second test for out arguments + This is a second test for out arguments - an int + an int - a #GObject + a #GObject - This is an argument test + This is an argument test - This is a 3th test for out arguments + This is a 3th test for out arguments - an int + an int - a #GObject + a #GObject caller-allocates="0" transfer-ownership="full" allow-none="1"> - This is an argument test + This is an argument test - an int + an int - a #GObject + a #GObject - An object, not referenced + An object, not referenced - a #GObject + a #GObject - This is a test for out arguments + This is a test for out arguments - an int + an int - a #GObject + a #GObject - This is an argument test + This is an argument test - Test taking a zero-terminated array with length parameter + Test taking a zero-terminated array with length parameter - a #RegressAnnotationObject + a #RegressAnnotationObject - Length of the argument vector + Length of the argument vector - Argument vector + Argument vector @@ -557,91 +557,91 @@ each string needs to be freed.
- Test taking a guchar * with a length. + Test taking a guchar * with a length. - a #RegressAnnotationObject + a #RegressAnnotationObject - The data + The data - Length of the data + Length of the data - Test taking a gchar * with a length. + Test taking a gchar * with a length. - a #RegressAnnotationObject + a #RegressAnnotationObject - The data + The data - Length of the data + Length of the data - Test taking a gchar * with a length, overriding the array element + Test taking a gchar * with a length, overriding the array element type. - a #RegressAnnotationObject + a #RegressAnnotationObject - The data + The data - Length of the data + Length of the data - Test returning a string as an out parameter + Test returning a string as an out parameter - some boolean + some boolean - a #RegressAnnotationObject + a #RegressAnnotationObject - string return value + string return value @@ -653,7 +653,7 @@ type. - a #GObject + a #GObject @@ -665,23 +665,23 @@ type. c:identifier="regress_annotation_object_watch" shadowed-by="watch_full" introspectable="0"> - This is here just for the sake of being overriden by its + This is here just for the sake of being overriden by its regress_annotation_object_watch_full(). - A #RegressAnnotationObject + A #RegressAnnotationObject - The callback + The callback - The callback data + The callback data @@ -689,13 +689,13 @@ regress_annotation_object_watch_full(). - Test overriding via the "Rename To" regress_annotation. + Test overriding via the "Rename To" annotation. - A #RegressAnnotationObject + A #RegressAnnotationObject scope="notified" closure="1" destroy="2"> - The callback + The callback - The callback data + The callback data - Destroy notification + Destroy notification @@ -727,7 +727,7 @@ regress_annotation_object_watch_full(). - Opaque pointer handle + Opaque pointer handle @@ -745,7 +745,7 @@ regress_annotation_object_watch_full(). writable="1" construct="1" transfer-ownership="none"> - This is a property which is a string + This is a property which is a string writable="1" construct="1" transfer-ownership="none"> - This is a property regress_annotation intentionally indented with a mix + This is a property annotation intentionally indented with a mix of tabs and strings to test the tab handling capabilities of the scanner. @@ -761,27 +761,27 @@ of tabs and strings to test the tab handling capabilities of the scanner. - This signal tests a signal with attributes. + This signal tests a signal with attributes. - - the return value + + the return value - - a value + + a value - - another value + + another value - This signal tests an empty document argument (@arg1) + This signal tests an empty document argument (@arg1) @@ -792,14 +792,14 @@ of tabs and strings to test the tab handling capabilities of the scanner. - This is a signal which takes a list of strings, but it's not + This is a signal which takes a list of strings, but it's not known by GObject as it's only marked as G_TYPE_POINTER - a list of strings + a list of strings @@ -811,14 +811,14 @@ known by GObject as it's only marked as G_TYPE_POINTER version="1.0" deprecated="Use other-signal instead" deprecated-version="1.2"> - This is a signal which has a broken signal handler, + This is a signal which has a broken signal handler, it says it's pointer but it's actually a string. - a string + a string @@ -832,7 +832,7 @@ it says it's pointer but it's actually a string. - This is a test of an array of object in an field of a struct. + This is a test of an array of object in an field of a struct. - This function is intended to match clutter_stage_get_default which + This function is intended to match clutter_stage_get_default which uses a C sugar return type. - The global #RegressFooSubobject + The global #RegressFooSubobject @@ -1300,7 +1300,7 @@ uses a C sugar return type. - Read some stuff. + Read some stuff. @@ -1309,11 +1309,11 @@ uses a C sugar return type. - offset + offset - length + length @@ -1333,7 +1333,7 @@ uses a C sugar return type. - This shouldn't be scanned as a constructor. + This shouldn't be scanned as a constructor. @@ -1359,12 +1359,12 @@ uses a C sugar return type. - %NULL always + %NULL always - a #RegressFooObject + a #RegressFooObject @@ -1410,7 +1410,7 @@ uses a C sugar return type. - Not sure why this test is here... + Not sure why this test is here... @@ -1424,21 +1424,21 @@ uses a C sugar return type. - Read some stuff. + Read some stuff. - obj + obj - offset + offset - length + length @@ -1446,13 +1446,13 @@ uses a C sugar return type. - This is only useful from C. + This is only useful from C. - obj + obj @@ -1570,11 +1570,11 @@ uses a C sugar return type. - offset + offset - length + length @@ -1621,11 +1621,11 @@ uses a C sugar return type. direction="inout" caller-allocates="0" transfer-ownership="full"> - add to this rect + add to this rect - source rectangle + source rectangle @@ -1633,7 +1633,7 @@ uses a C sugar return type. - This is a C convenience constructor; we have to (skip) + This is a C convenience constructor; we have to (skip) it because it's not a boxed type. @@ -1657,13 +1657,13 @@ it because it's not a boxed type. - Some type that is only interesting from C and should not be + Some type that is only interesting from C and should not be exposed to language bindings. - a skippable enum value + a skippable enum value - another skippable enum value + another skippable enum value @@ -1925,7 +1925,7 @@ exposed to language bindings. - Like telepathy-glib's TpIntset. + Like telepathy-glib's TpIntset. + + + + + + + + + + + + + + + + + + + + @@ -1974,7 +1995,7 @@ exposed to language bindings. - This should be skipped, and moreover, all function which + This should be skipped, and moreover, all function which use it should be. @@ -2227,15 +2248,15 @@ use it should be. - the investment rate + the investment rate - how much money + how much money - Path to file + Path to file @@ -2257,7 +2278,7 @@ use it should be. - a hash table; will be modified + a hash table; will be modified @@ -2272,7 +2293,7 @@ use it should be. - GError instance; must be freed by the callback + GError instance; must be freed by the callback @@ -2307,18 +2328,18 @@ use it should be. glib:type-name="RegressTestEnum" glib:get-type="regress_test_enum_get_type" c:type="RegressTestEnum"> - By purpose, not all members have documentation + By purpose, not all members have documentation - value 1 + value 1 - value 2 + value 2 glib:type-struct="TestFloatingClass"> - A new floating #RegressTestFloating + A new floating #RegressTestFloating @@ -2449,7 +2470,7 @@ use it should be. glib:get-value-func="regress_test_value_get_fundamental_object"> - A new #RegressTestFundamentalObject + A new #RegressTestFundamentalObject @@ -2697,7 +2718,7 @@ use it should be. - A #RegressTestObj + A #RegressTestObj @@ -2746,7 +2767,7 @@ use it should be. caller-allocates="0" transfer-ownership="full" allow-none="1"> - A #RegressTestObj + A #RegressTestObj @@ -2785,13 +2806,13 @@ use it should be. - Another object + Another object - This method is virtual. Notably its name differs from the virtual + This method is virtual. Notably its name differs from the virtual slot name, which makes it useful for testing bindings handle this case. @@ -2802,13 +2823,13 @@ case. - Meaningless string + Meaningless string - This method is virtual. Notably its name differs from the virtual + This method is virtual. Notably its name differs from the virtual slot name, which makes it useful for testing bindings handle this case. @@ -2816,11 +2837,11 @@ case. - A #RegressTestObj + A #RegressTestObj - Meaningless string + Meaningless string @@ -2875,7 +2896,7 @@ case. - A #RegressTestObj + A #RegressTestObj @@ -2924,29 +2945,29 @@ case. - Check that the out value is skipped + Check that the out value is skipped - %TRUE if the call succeeds, %FALSE if @error is set. + %TRUE if the call succeeds, %FALSE if @error is set. - A #RegressTestObj. + A #RegressTestObj. - Parameter. + Parameter. - Return value. + Return value. - Other parameter. + Other parameter. caller-allocates="0" transfer-ownership="full" skip="1"> - Will be incremented. + Will be incremented. - Return value. + Return value. - Number. + Number. - Number. + Number. @@ -2977,18 +2998,18 @@ case. - Check that the out value is skipped + Check that the out value is skipped - %TRUE if the call succeeds, %FALSE if @error is set. + %TRUE if the call succeeds, %FALSE if @error is set. - A #RegressTestObj. + A #RegressTestObj. - Parameter. + Parameter. caller-allocates="0" transfer-ownership="full" skip="1"> - Return value. + Return value. - Other parameter. + Other parameter. - Will be incremented. + Will be incremented. - Return value. + Return value. - Number. + Number. - Number. + Number. @@ -3030,51 +3051,51 @@ case. - Check that a parameter is skipped + Check that a parameter is skipped - %TRUE if the call succeeds, %FALSE if @error is set. + %TRUE if the call succeeds, %FALSE if @error is set. - A #RegressTestObj. + A #RegressTestObj. - Parameter. + Parameter. - Return value. + Return value. - Other parameter. + Other parameter. - Will be incremented. + Will be incremented. - Return value. + Return value. - Number. + Number. - Number. + Number. @@ -3082,51 +3103,51 @@ case. - Check that the return value is skipped + Check that the return value is skipped - %TRUE if the call succeeds, %FALSE if @error is set. + %TRUE if the call succeeds, %FALSE if @error is set. - a #RegressTestObj + a #RegressTestObj - Parameter. + Parameter. - A return value. + A return value. - Other parameter. + Other parameter. - Will be incremented. + Will be incremented. - Return value. + Return value. - Number. + Number. - Number. + Number. @@ -3134,19 +3155,19 @@ case. - Check that the return value is skipped. Succeed if a is nonzero, otherwise + Check that the return value is skipped. Succeed if a is nonzero, otherwise raise an error. - %TRUE if the call succeeds, %FALSE if @error is set. + %TRUE if the call succeeds, %FALSE if @error is set. - a #RegressTestObj + a #RegressTestObj - Parameter. + Parameter. @@ -3158,7 +3179,7 @@ raise an error. - A #RegressTestObj + A #RegressTestObj @@ -3193,13 +3214,13 @@ raise an error. - This function throws an error if m is odd. + This function throws an error if m is odd. - A #RegressTestObj + A #RegressTestObj @@ -3332,32 +3353,32 @@ raise an error. - This test signal similar to GSettings::change-event + This test signal similar to GSettings::change-event - numbers, or %NULL + numbers, or %NULL - length of @arr, or 0 + length of @arr, or 0 - This test signal is like TelepathyGlib's + This test signal is like TelepathyGlib's TpChannel:: group-members-changed-detailed: - numbers + numbers @@ -3370,13 +3391,13 @@ raise an error. - A cairo context. + A cairo context. - This test signal is like TelepathyGlib's + This test signal is like TelepathyGlib's TpAccount::status-changed @@ -3391,14 +3412,14 @@ raise an error. - You can use this with regress_test_obj_emit_sig_with_int64, or raise from + You can use this with regress_test_obj_emit_sig_with_int64, or raise from the introspection client langage. - an integer + an integer @@ -3411,32 +3432,32 @@ the introspection client langage. - an integer + an integer - Test transfer none GObject as a param (tests refcounting). + Test transfer none GObject as a param (tests refcounting). Use with regress_test_obj_emit_sig_with_obj - A newly created RegressTestObj + A newly created RegressTestObj - Test GStrv as a param. + Test GStrv as a param. - strings + strings @@ -3444,14 +3465,14 @@ Use with regress_test_obj_emit_sig_with_obj - You can use this with regress_test_obj_emit_sig_with_uint64, or raise from + You can use this with regress_test_obj_emit_sig_with_uint64, or raise from the introspection client langage. - an integer + an integer @@ -3491,7 +3512,7 @@ the introspection client langage. - Meaningless string + Meaningless string @@ -3507,7 +3528,7 @@ the introspection client langage. - Another object + Another object @@ -3685,20 +3706,20 @@ the introspection client langage. - Make a copy of a RegressTestStructA + Make a copy of a RegressTestStructA - the structure + the structure - the cloned structure + the cloned structure @@ -3712,11 +3733,11 @@ the introspection client langage. direction="out" caller-allocates="1" transfer-ownership="none"> - the structure that is to be filled + the structure that is to be filled - ignored + ignored @@ -3730,20 +3751,20 @@ the introspection client langage. - Make a copy of a RegressTestStructB + Make a copy of a RegressTestStructB - the structure + the structure - the cloned structure + the cloned structure @@ -3996,29 +4017,28 @@ the introspection client langage. - - - The return value. + + + The return value. - A #RegressAnnotationObject. + A #RegressAnnotationObject. - - - Some data. + + + Some data. - Test messing up the heuristic of closure/destroy-notification -detection, and fixing it via regress_annotations. + Test messing up the heuristic of closure/destroy-notification +detection, and fixing it via annotations. @@ -4028,7 +4048,7 @@ detection, and fixing it via regress_annotations. scope="notified" closure="2" destroy="1"> - Destroy notification + Destroy notification - Source file + Source file @@ -4059,14 +4079,14 @@ detection, and fixing it via regress_annotations. direction="inout" caller-allocates="0" transfer-ownership="full"> - The number of args. + The number of args. - The arguments. + The arguments. @@ -4080,7 +4100,7 @@ detection, and fixing it via regress_annotations. - some text (e.g. example) or else + some text (e.g. example) or else @@ -4092,7 +4112,7 @@ detection, and fixing it via regress_annotations. - the array + the array @@ -4102,7 +4122,7 @@ detection, and fixing it via regress_annotations. - The return value + The return value @@ -4112,7 +4132,7 @@ detection, and fixing it via regress_annotations. direction="out" caller-allocates="0" transfer-ownership="full"> - Number of return values + Number of return values @@ -4120,7 +4140,7 @@ detection, and fixing it via regress_annotations. - An annotated filename + An annotated filename @@ -4131,14 +4151,14 @@ detection, and fixing it via regress_annotations. - Source file + Source file - Explicitly test having a space after the ** here. + Explicitly test having a space after the ** here. @@ -4162,7 +4182,7 @@ detection, and fixing it via regress_annotations. - The return value + The return value @@ -4186,16 +4206,16 @@ detection, and fixing it via regress_annotations. - See https://bugzilla.gnome.org/show_bug.cgi?id=630862 + See https://bugzilla.gnome.org/show_bug.cgi?id=630862 - An object, note the colon:in here + An object, note the colon:in here - A floating object + A floating object @@ -4324,7 +4344,7 @@ detection, and fixing it via regress_annotations. - This should be scanned as a top-level function, and shouldn't cause + This should be scanned as a top-level function, and shouldn't cause a "Can't find matching type for constructor" warning. @@ -4334,7 +4354,7 @@ a "Can't find matching type for constructor" warning. c:identifier="regress_foo_rectangle_new" moved-to="FooRectangle.new" introspectable="0"> - This is a C convenience constructor; we have to (skip) + This is a C convenience constructor; we have to (skip) it because it's not a boxed type. @@ -4357,14 +4377,14 @@ it because it's not a boxed type. - Does something that's only interesting from C and should not be + Does something that's only interesting from C and should not be exposed to language bindings. - a #RegressFooSkippable + a #RegressFooSkippable @@ -4536,7 +4556,7 @@ exposed to language bindings. - A #RegressTestObj + A #RegressTestObj @@ -4551,25 +4571,25 @@ exposed to language bindings. direction="out" caller-allocates="0" transfer-ownership="full"> - A flags value + A flags value - This test case mirrors GnomeKeyringPasswordSchema from + This test case mirrors GnomeKeyringPasswordSchema from libgnome-keyring. - some int + some int - list of attributes + list of attributes @@ -4656,7 +4676,7 @@ libgnome-keyring. direction="out" caller-allocates="0" transfer-ownership="full"> - An array of #RegressTestObj + An array of #RegressTestObj @@ -4666,12 +4686,12 @@ libgnome-keyring. - the sum of the items in @ints + the sum of the items in @ints - a list of 5 integers + a list of 5 integers @@ -4688,7 +4708,7 @@ libgnome-keyring. direction="out" caller-allocates="0" transfer-ownership="full"> - a list of 5 integers ranging from 0 to 4 + a list of 5 integers ranging from 0 to 4 @@ -4698,7 +4718,7 @@ libgnome-keyring. - a list of 5 integers ranging from 0 to 4 + a list of 5 integers ranging from 0 to 4 @@ -4714,7 +4734,7 @@ libgnome-keyring. - List of ints + List of ints @@ -4731,7 +4751,7 @@ libgnome-keyring. - List of ints + List of ints @@ -4748,7 +4768,7 @@ libgnome-keyring. - List of ints + List of ints @@ -4765,7 +4785,7 @@ libgnome-keyring. - List of ints + List of ints @@ -4775,7 +4795,7 @@ libgnome-keyring. - string representation of provided types + string representation of provided types @@ -4783,7 +4803,7 @@ libgnome-keyring. - List of types + List of types @@ -4793,7 +4813,7 @@ libgnome-keyring. - a new array of integers. + a new array of integers. @@ -4803,7 +4823,7 @@ libgnome-keyring. direction="out" caller-allocates="0" transfer-ownership="full"> - length of the returned array. + length of the returned array. @@ -4818,7 +4838,7 @@ libgnome-keyring. - List of ints + List of ints @@ -4835,14 +4855,14 @@ libgnome-keyring. direction="inout" caller-allocates="0" transfer-ownership="full"> - the length of @ints + the length of @ints - a list of integers whose items will be increased by 1, except the first that will be dropped + a list of integers whose items will be increased by 1, except the first that will be dropped @@ -4852,7 +4872,7 @@ libgnome-keyring. - a static array of integers. + a static array of integers. @@ -4862,7 +4882,7 @@ libgnome-keyring. direction="out" caller-allocates="0" transfer-ownership="full"> - length of the returned array. + length of the returned array. @@ -4879,7 +4899,7 @@ libgnome-keyring. - length + length @@ -4903,7 +4923,7 @@ libgnome-keyring. direction="out" caller-allocates="0" transfer-ownership="full"> - length + length @@ -4918,14 +4938,14 @@ libgnome-keyring. direction="out" caller-allocates="0" transfer-ownership="full"> - the length of @ints + the length of @ints - a list of 5 integers, from 0 to 4 in consecutive order + a list of 5 integers, from 0 to 4 in consecutive order @@ -5065,7 +5085,7 @@ libgnome-keyring. - Notified - callback persists until a DestroyNotify delegate + Notified - callback persists until a DestroyNotify delegate is invoked. @@ -5089,7 +5109,7 @@ is invoked. - Adds a scope notified callback with no user data. This can invoke an error + Adds a scope notified callback with no user data. This can invoke an error condition in bindings which needs to be tested. @@ -5115,17 +5135,17 @@ condition in bindings which needs to be tested. - Invokes all callbacks installed by #test_callback_destroy_notify(), + Invokes all callbacks installed by #test_callback_destroy_notify(), adding up their return values, and removes them, invoking the corresponding destroy notfications. - Sum of the return values of the invoked callbacks. + Sum of the return values of the invoked callbacks. - Call - callback parameter persists for the duration of the method + Call - callback parameter persists for the duration of the method call and can be released on return. @@ -5170,16 +5190,16 @@ call and can be released on return. - the return value of @closure + the return value of @closure - GClosure which takes one GVariant and returns a GVariant + GClosure which takes one GVariant and returns a GVariant - a GVariant passed as argument to @closure + a GVariant passed as argument to @closure @@ -5228,7 +5248,7 @@ call and can be released on return. - list of strings + list of strings @@ -5296,7 +5316,7 @@ call and can be released on return. - the hash table returned by regress_test_ghash_gvalue_return(). + the hash table returned by regress_test_ghash_gvalue_return(). @@ -5315,7 +5335,7 @@ call and can be released on return. - Specify nested parameterized types directly with the (type ) annotation. + Specify nested parameterized types directly with the (type ) annotation. @@ -5328,7 +5348,7 @@ call and can be released on return. - Another way of specifying nested parameterized types: using the + Another way of specifying nested parameterized types: using the element-type annotation. @@ -5615,32 +5635,32 @@ element-type annotation. - New variant + New variant - New variant + New variant - New variant + New variant - New variant + New variant - New variant + New variant @@ -5651,7 +5671,7 @@ element-type annotation. - GHashTable that gets passed to callback + GHashTable that gets passed to callback @@ -5790,7 +5810,7 @@ element-type annotation. - This is a function. + This is a function. It has multiple lines in the documentation. @@ -5803,7 +5823,7 @@ You will give me your credit card number. - <informaltable> + <informaltable> <tgroup cols="3"> <thead> <row> @@ -5836,7 +5856,7 @@ What we're testing here is that the scanner ignores the @a nested inside XML. - An integer + An integer @@ -5908,14 +5928,14 @@ What we're testing here is that the scanner ignores the @a nested inside XML. - Should not emit a warning: + Should not emit a warning: https://bugzilla.gnome.org/show_bug.cgi?id=685399 - No annotation here + No annotation here @@ -5941,11 +5961,11 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 direction="out" caller-allocates="1" transfer-ownership="none"> - the structure that is to be filled + the structure that is to be filled - ignored + ignored @@ -6053,7 +6073,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 - This function throws an error if m is odd. + This function throws an error if m is odd. @@ -6248,7 +6268,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 - UTF-8 string + UTF-8 string @@ -6268,7 +6288,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 - UTF-8 string + UTF-8 string @@ -6314,7 +6334,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 - a copy of "first" + a copy of "first" @@ -6322,7 +6342,7 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 direction="out" caller-allocates="0" transfer-ownership="full"> - a copy of "second" + a copy of "second" @@ -6337,14 +6357,14 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 direction="out" caller-allocates="0" transfer-ownership="full"> - a copy of "first" + a copy of "first" - a copy of "second" + a copy of "second" @@ -6365,12 +6385,12 @@ https://bugzilla.gnome.org/show_bug.cgi?id=685399 - the int wrapped in a GValue. + the int wrapped in a GValue. - an int + an int diff --git a/tests/scanner/annotation.c b/tests/scanner/annotation.c index f3cfb42..0a92d3a 100644 --- a/tests/scanner/annotation.c +++ b/tests/scanner/annotation.c @@ -128,12 +128,12 @@ regress_annotation_object_class_init (RegressAnnotationObjectClass *klass) /** * RegressAnnotationObject::attribute-signal: * @regress_annotation: the regress_annotation object - * @arg1: (attribute some.regress_annotation.foo1 val1): a value - * @arg2: (attribute some.regress_annotation.foo2 val2): another value + * @arg1: (attribute some.annotation.foo1 val1): a value + * @arg2: (attribute some.annotation.foo2 val2): another value * * This signal tests a signal with attributes. * - * Returns: (attribute some.regress_annotation.foo3 val3): the return value + * Returns: (attribute some.annotation.foo3 val3): the return value */ regress_annotation_object_signals[ATTRIBUTE_SIGNAL] = g_signal_new ("attribute-signal", @@ -174,14 +174,14 @@ regress_annotation_object_class_init (RegressAnnotationObjectClass *klass) "This property is a function pointer", G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); - /** - * RegressAnnotationObject:tab-property: - * - * This is a property regress_annotation intentionally indented with a mix - * of tabs and strings to test the tab handling capabilities of the scanner. - * - * Since: 1.2 - */ + /** + * RegressAnnotationObject:tab-property: + * + * This is a property annotation intentionally indented with a mix + * of tabs and strings to test the tab handling capabilities of the scanner. + * + * Since: 1.2 + */ g_object_class_install_property (gobject_class, PROP_TAB_PROPERTY, g_param_spec_string ("tab-property", @@ -622,7 +622,7 @@ regress_annotation_object_watch (RegressAnnotationObject *object, * @user_data: The callback data * @destroy: Destroy notification * - * Test overriding via the "Rename To" regress_annotation. + * Test overriding via the "Rename To" annotation. * * Rename to: regress_annotation_object_watch */ @@ -721,7 +721,7 @@ regress_annotation_object_extra_annos (RegressAnnotationObject *object) * @callback: (destroy destroy) (closure data): Destroy notification * * Test messing up the heuristic of closure/destroy-notification - * detection, and fixing it via regress_annotations. + * detection, and fixing it via annotations. */ void regress_annotation_custom_destroy (RegressAnnotationCallback callback, @@ -763,9 +763,9 @@ regress_annotation_ptr_array (GPtrArray *array) /** * regress_annotation_attribute_func: * @object: A #RegressAnnotationObject. - * @data: (attribute some.regress_annotation value) (attribute another.regress_annotation blahvalue): Some data. + * @data: (attribute some.annotation value) (attribute another.annotation blahvalue): Some data. * - * Returns: (attribute some.other.regress_annotation value2) (attribute yet.another.regress_annotation another_value): The return value. + * Returns: (attribute some.other.annotation value2) (attribute yet.another.annotation another_value): The return value. */ gint regress_annotation_attribute_func (RegressAnnotationObject *object, diff --git a/tests/scanner/annotation.h b/tests/scanner/annotation.h index 154b0d8..66470cb 100644 --- a/tests/scanner/annotation.h +++ b/tests/scanner/annotation.h @@ -39,7 +39,7 @@ typedef void (*RegressAnnotationNotifyFunc) (gpointer data); /** * RegressAnnotationObject: * - * This is an object used to test regress_annotations. + * This is an object used to test annotations. * * Attributes: (org.example.Test cows) */ diff --git a/tests/scanner/annotationparser/test_parser.py b/tests/scanner/annotationparser/test_parser.py index a1c5866..ce3ccd2 100644 --- a/tests/scanner/annotationparser/test_parser.py +++ b/tests/scanner/annotationparser/test_parser.py @@ -108,7 +108,7 @@ def parsed2tree(docblock): parsed += ' \n' for key, value in tag.options.values: parsed += ' \n' - parsed += ' %s\n' %(key, ) + parsed += ' %s\n' % (key, ) if value is not None: options = value.all() parsed += ' \n' @@ -130,6 +130,7 @@ def parsed2tree(docblock): return parsed + def expected2tree(docblock): # Note: this sucks, but we can't rely on etree.tostring() to generate useable output :( diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c index f54c2f9..d32c52b 100644 --- a/tests/scanner/regress.c +++ b/tests/scanner/regress.c @@ -4007,3 +4007,11 @@ void regress_test_versioning (void) { } + +void +regress_like_xkl_config_item_set_name (RegressLikeXklConfigItem *self, + const char *name) +{ + strncpy (self->name, name, sizeof (self->name) - 1); + self->name[sizeof(self->name)-1] = '\0'; +} diff --git a/tests/scanner/regress.h b/tests/scanner/regress.h index ba82ca8..274d0e4 100644 --- a/tests/scanner/regress.h +++ b/tests/scanner/regress.h @@ -7,6 +7,8 @@ #include #include #include +#include +#include void regress_set_abort_on_error (gboolean abort_on_error); @@ -905,6 +907,13 @@ typedef struct { void regress_test_struct_fixed_array_frob (RegressTestStructFixedArray *str); +typedef struct { + gchar name[32]; +} RegressLikeXklConfigItem; + +void regress_like_xkl_config_item_set_name (RegressLikeXklConfigItem *self, + const char *name); + #define REGRESS_UTF8_CONSTANT "const \xe2\x99\xa5 utf8" #ifdef __GNUC__ diff --git a/tests/warn/Makefile.am b/tests/warn/Makefile.am index 875d8ef..bce4562 100644 --- a/tests/warn/Makefile.am +++ b/tests/warn/Makefile.am @@ -6,7 +6,6 @@ alltests = \ annotationparser.h \ callback-invalid-scope.h \ callback-missing-scope.h \ - return-gobject.h \ invalid-array.h \ invalid-closure.h \ invalid-constructor.h \ @@ -16,9 +15,10 @@ alltests = \ invalid-out.h \ invalid-transfer.h \ missing-element-type.h \ + return-gobject.h \ unknown-parameter.h \ unresolved-type.h -EXTRA_DIST = warningtester.py warntestrunner $(alltests) common.h $(TESTS) +EXTRA_DIST = warningtester.py $(alltests) common.h $(TESTS) TESTS_ENVIRONMENT = PYTHONPATH=$(top_builddir):$(top_srcdir) TOP_BUILDDIR=$(top_builddir) UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) PYTHON=$(PYTHON) srcdir=$(srcdir) alltests="$(alltests)" diff --git a/tests/warn/Makefile.in b/tests/warn/Makefile.in index a731e64..081e788 100644 --- a/tests/warn/Makefile.in +++ b/tests/warn/Makefile.in @@ -517,7 +517,6 @@ alltests = \ annotationparser.h \ callback-invalid-scope.h \ callback-missing-scope.h \ - return-gobject.h \ invalid-array.h \ invalid-closure.h \ invalid-constructor.h \ @@ -527,10 +526,11 @@ alltests = \ invalid-out.h \ invalid-transfer.h \ missing-element-type.h \ + return-gobject.h \ unknown-parameter.h \ unresolved-type.h -EXTRA_DIST = warningtester.py warntestrunner $(alltests) common.h $(TESTS) +EXTRA_DIST = warningtester.py $(alltests) common.h $(TESTS) TESTS_ENVIRONMENT = PYTHONPATH=$(top_builddir):$(top_srcdir) TOP_BUILDDIR=$(top_builddir) UNINSTALLED_INTROSPECTION_SRCDIR=$(top_srcdir) PYTHON=$(PYTHON) srcdir=$(srcdir) alltests="$(alltests)" all: all-am diff --git a/tests/warn/warningtester.py b/tests/warn/warningtester.py index 27e0a5e..fc3c3d2 100644 --- a/tests/warn/warningtester.py +++ b/tests/warn/warningtester.py @@ -61,23 +61,24 @@ def _diff(a, b): for line in a[i1:i2]: for l in line.split('\n'): if l != '': - retval += ' ' + l + '\n' + retval += ' ' + l + '\n' continue if tag in ('replace', 'delete'): for line in a[i1:i2]: for l in line.split('\n'): if l != '': - retval += '-' + l + '\n' + retval += '-' + l + '\n' if tag in ('replace', 'insert'): for line in b[j1:j2]: for l in line.split('\n'): if l != '': - retval += '+' + l + '\n' + retval += '+' + l + '\n' return retval + def _extract_expected(filename): fd = open(filename, 'rU') data = fd.read() @@ -92,6 +93,7 @@ def _extract_expected(filename): return retval + def check(args): filename = args[0] @@ -133,10 +135,10 @@ def check(args): if len(expected_warnings) != len(emitted_warnings): raise SystemExit('ERROR in %r: %d warnings were emitted, ' - 'expected %d:\n%s' %(os.path.basename(filename), - len(emitted_warnings), - len(expected_warnings), - _diff(expected_warnings, emitted_warnings))) + 'expected %d:\n%s' % (os.path.basename(filename), + len(emitted_warnings), + len(expected_warnings), + _diff(expected_warnings, emitted_warnings))) for emitted_warning, expected_warning in zip(emitted_warnings, expected_warnings): if expected_warning != emitted_warning: diff --git a/tests/warn/warntestrunner b/tests/warn/warntestrunner index 3deb381..d3a4e87 100755 --- a/tests/warn/warntestrunner +++ b/tests/warn/warntestrunner @@ -4,5 +4,5 @@ set -e for testname in ${alltests}; do echo "Running warning test:" $testname - $PYTHON $srcdir/warningtester.py "$testname" + $PYTHON $srcdir/warningtester.py "$srcdir/$testname" done -- 2.7.4